22 const double floatMilliseconds = 1000 * (floatSpan / CLOCKS_PER_SEC);
23 unsigned long milliseconds =
static_cast<unsigned long>(floatMilliseconds);
24 if (floatMilliseconds - milliseconds >= 0.5)
31 unsigned long seconds = milliseconds / 1000;
32 unsigned long minutes = seconds / 60;
33 unsigned long hours = minutes / 60;
41 fprintf(out,
"%luh", hours);
42 if (minutes != 0 || hours != 0)
43 fprintf(out,
"%lum", minutes);
44 fprintf(out,
"%lu.%03lus)", seconds, milliseconds);
void print(FILE *out) const
Prints the elapsed time in a human readable format.
unsigned long getMilliseconds() const
Returns the number of CPU milliseconds since the last reset.
std::clock_t _clocksAtReset