Caffe2 - C++ API
A deep learning, cross platform ML framework
time_profiler.h
1 #pragma once
2 #include "profiler.h"
3 
4 namespace caffe2 {
5 namespace emulator {
6 
7 /*
8  * An profiler that measures the walltime of a @runnable
9  */
10 class TimeProfiler : public Profiler {
11  public:
12  float profile(std::function<void()> runnable) override {
13  Timer timer;
14  runnable();
15  return timer.MilliSeconds();
16  }
17 };
18 
19 } // namespace emulator
20 } // namespace caffe2
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13
float MilliSeconds()
Returns the elapsed time in milliseconds.
Definition: timer.h:32
A simple timer object for measuring time.
Definition: timer.h:16