Geogram Version 1.8.5
A programming library of geometric algorithms
|
Measures the time taken by an algorithm. More...
#include <geogram/basic/stopwatch.h>
Public Member Functions | |
SystemStopwatch () | |
SystemStopwatch constructor. | |
void | print_elapsed_time (std::ostream &os) const |
Prints elapsed time to a stream. | |
double | elapsed_user_time () const |
Get the user elapsed time. | |
Static Public Member Functions | |
static double | now () |
Measures the time taken by an algorithm.
SystemStopwatch provides functions to get or print the time elapsed since its construction. The times computed by SystemStopwatch are expressed as system ticks, which is a system dependent unit. SystemStopwatch prints three different times:
Example:
Definition at line 89 of file stopwatch.h.
GEO::SystemStopwatch::SystemStopwatch | ( | ) |
SystemStopwatch constructor.
It remembers the current time as the reference time for functions elapsed_user_time() and print_elapsed_time().
double GEO::SystemStopwatch::elapsed_user_time | ( | ) | const |
Get the user elapsed time.
Returns the user time elapsed since the SystemStopWatch construction (in seconds)
|
static |
Gets the current time (in seconds).
void GEO::SystemStopwatch::print_elapsed_time | ( | std::ostream & | os | ) | const |
Prints elapsed time to a stream.
Prints real, user and system times since the construction of this SystemStopWatch (in seconds).