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
Commit
30caa801
authored
Apr 12, 2013
by
Davis King
Browse files
Added additional documentation to the code block timing tools.
parent
3a51de83
Changes
1
Hide 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 @@
#include <iostream>
// ----------------------------------------------------------------------------------------
/*!A timing
This set of functions is useful for determining how much time is spent
...
...
@@ -39,8 +41,34 @@
block #2: 10.0 seconds
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
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