Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
30caa801
"...model_executor/git@developer.sourcefind.cn:norm/vllm.git" did not exist on "f756799b84f5558c82c7a049069f845b31573e9e"
Commit
30caa801
authored
Apr 12, 2013
by
Davis King
Browse files
Added additional documentation to the code block timing tools.
parent
3a51de83
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
dlib/timing.h
dlib/timing.h
+28
-0
No files found.
dlib/timing.h
View file @
30caa801
...
@@ -9,6 +9,8 @@
...
@@ -9,6 +9,8 @@
#include <iostream>
#include <iostream>
// ----------------------------------------------------------------------------------------
/*!A timing
/*!A timing
This set of functions is useful for determining how much time is spent
This set of functions is useful for determining how much time is spent
...
@@ -39,8 +41,34 @@
...
@@ -39,8 +41,34 @@
block #2: 10.0 seconds
block #2: 10.0 seconds
So we spent 5 seconds in block #1 and 10 seconds in block #2
So we spent 5 seconds in block #1 and 10 seconds in block #2
Additionally, note that you can use an RAII style timing block object. For
example, if we wanted to find out how much time we spent in a loop a convenient
way to do this would be as follows:
int main()
{
using namespace dlib::timing;
for (int i = 0; i < 10; ++i)
{
block tb(1, "main loop");
dlib::sleep(1500);
}
print();
}
This program would output:
Timing report:
block main loop: 15.0 seconds
!*/
!*/
// ----------------------------------------------------------------------------------------
namespace
dlib
namespace
dlib
{
{
namespace
timing
namespace
timing
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment