Commit 30caa801 authored by Davis King's avatar Davis King

Added additional documentation to the code block timing tools.

parent 3a51de83
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment