24 #if defined(_MSC_VER) || defined(__MINGW32__) 26 #ifndef _TIMEVAL_DEFINED 27 #define _TIMEVAL_DEFINED 34 int gettimeofday(
struct timeval* tp,
void* tzp) {
37 tp->tv_sec = t / 1000;
38 tp->tv_usec = t % 1000;
54 CTime(
bool start=
true);
62 clock_t cur_runtime(
bool verbose=
false);
69 clock_t cur_runtime_diff(
bool verbose=
false);
77 float64_t cur_runtime_diff_sec(
bool verbose=
false);
92 float64_t cur_time_diff(
bool verbose=
false);
99 float64_t time_diff_sec(
bool verbose=
false);
113 clock_t start_runtime = clock();
114 return ((
float64_t) start_runtime)/CLOCKS_PER_SEC;
124 if (gettimeofday(&tv, NULL)==0)
125 return tv.tv_sec+(tv.tv_usec*1e-6);
131 virtual const char*
get_name()
const {
return "Time"; }
Class Time that implements a stopwatch based on either cpu time or wall clock time.
static float64_t get_runtime()
static float64_t get_curtime()
Class SGObject is the base class of all shogun objects.
all of classes and functions are contained in the shogun namespace
virtual const char * get_name() const