Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
30caa801
Commit
30caa801
authored
Apr 12, 2013
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added additional documentation to the code block timing tools.
parent
3a51de83
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
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