MCPcopy Create free account
hub / github.com/apache/singa / Elapsed

Method Elapsed

include/singa/utils/timer.h:42–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40 /// The returned value is the count of the time metric.
41 template <typename T = Milliseconds>
42 int Elapsed() const {
43 static_assert(
44 std::is_same<T, Seconds>::value ||
45 std::is_same<T, Milliseconds>::value ||
46 std::is_same<T, Hours>::value ||
47 std::is_same<T, Microseconds>::value,
48 "Template arg must be Seconds | Milliseconds | Hours | Microseconds");
49 auto now = std::chrono::high_resolution_clock::now();
50 return std::chrono::duration_cast<T>(now - last_).count();
51 }
52 /// Return the string rep of current wall time
53 // std::string CurrentTime();
54

Callers 3

TESTFunction · 0.80
TrainOneEpochFunction · 0.80
TestOneEpochFunction · 0.80

Calls

no outgoing calls

Tested by 2

TESTFunction · 0.64
TestOneEpochFunction · 0.64