HILA
|
#include <timing.h>
Timers are used to time recurring events. Usage:
static timer loop_timer("Loop"); loop_timer.start(); < timed section > loop_timer.stop();
All timer values are automatically reported on program exit (hila::finishrun calls report_timers())
Timer can be reset with loop_timer.reset();
Timer value can be inquired with timer_value tval = loop_timer.value(); where timer_value is a struct defined below.
Other time related functions: double gettime(); - returns the time in seconds from program start void timestamp("message"); - prints msg + current date+time + time from start
void setup_timelimit(long seconds); - sets the cpu time limit (see time_to_exit()) bool time_to_exit(); - to be called periodically at a suitable spot in the program; returns true if the program should exit now.