MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / MilliSeconds

Method MilliSeconds

rtpose_wrapper/src/caffe/util/benchmark.cpp:82–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82float Timer::MilliSeconds() {
83 if (!has_run_at_least_once()) {
84 LOG(WARNING) << "Timer has never been run before reading time.";
85 return 0;
86 }
87 if (running()) {
88 Stop();
89 }
90 if (Caffe::mode() == Caffe::GPU) {
91#ifndef CPU_ONLY
92 CUDA_CHECK(cudaEventElapsedTime(&elapsed_milliseconds_, start_gpu_,
93 stop_gpu_));
94#else
95 NO_GPU;
96#endif
97 } else {
98 elapsed_milliseconds_ = (stop_cpu_ - start_cpu_).total_milliseconds();
99 }
100 return elapsed_milliseconds_;
101}
102
103float Timer::Seconds() {
104 return MilliSeconds() / 1000.;

Callers 5

timeFunction · 0.80
TYPED_TESTFunction · 0.80
load_batchMethod · 0.80
load_batchMethod · 0.80
load_batchMethod · 0.80

Calls

no outgoing calls

Tested by 1

TYPED_TESTFunction · 0.64