MCPcopy Create free account
hub / github.com/LiangliangNan/PolyFit / elapsed

Method elapsed

code/basic/stop_watch.cpp:44–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44double StopWatch::elapsed() const {
45#ifdef WIN32
46 LARGE_INTEGER largeInteger;
47 QueryPerformanceCounter(&largeInteger);
48 LONGLONG now_count = largeInteger.QuadPart;
49 double time = (double)( (now_count - start_count_) / static_cast<double>(freq_) );
50#else
51 timeval now;
52 gettimeofday(&now, 0);
53 double time = (now.tv_sec - start_time_.tv_sec) + (now.tv_usec - start_time_.tv_usec) / 1.0e6;
54#endif // WIN32
55 return truncate_digits(time, 2);
56}

Callers 8

readMethod · 0.80
saveMethod · 0.80
readMethod · 0.80
saveMethod · 0.80
compute_confidencesMethod · 0.80
optimizeMethod · 0.80
re_orientMethod · 0.80

Calls 1

truncate_digitsFunction · 0.85

Tested by

no test coverage detected