23 #if defined(_MSC_VER) || defined(__MINGW32__) 25 #ifndef _TIMEVAL_DEFINED 26 #define _TIMEVAL_DEFINED 33 int gettimeofday(
struct timeval* tp,
void* tzp) {
36 tp->tv_sec = t / 1000;
37 tp->tv_usec = t % 1000;
53 CTime(
bool start=
true);
61 clock_t cur_runtime(
bool verbose=
false);
68 clock_t cur_runtime_diff(
bool verbose=
false);
76 float64_t cur_runtime_diff_sec(
bool verbose=
false);
91 float64_t cur_time_diff(
bool verbose=
false);
98 float64_t time_diff_sec(
bool verbose=
false);
112 clock_t start_runtime = clock();
113 return ((
float64_t) start_runtime)/CLOCKS_PER_SEC;
123 if (gettimeofday(&tv, NULL)==0)
124 return tv.tv_sec+(tv.tv_usec*1e-6);
130 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