MNN  1.0
AutoTime.hpp
浏览该文件的文档.
1 //
2 // AutoTime.hpp
3 // MNN
4 //
5 // Created by MNN on 2018/07/27.
6 // Copyright © 2018, Alibaba Group Holding Limited
7 //
8 
9 #ifndef AutoTime_hpp
10 #define AutoTime_hpp
11 
12 #include <stdint.h>
13 #include <stdio.h>
14 #include "MNNDefine.h"
15 
16 namespace MNN {
17 
20 public:
21  AutoTime(int line, const char* func);
22  ~AutoTime();
23  AutoTime(const AutoTime&) = delete;
24  AutoTime(const AutoTime&&) = delete;
25  AutoTime& operator=(const AutoTime&) = delete;
26  AutoTime& operator=(const AutoTime&&) = delete;
27 
28 private:
29  int mLine;
30  char* mName;
31  uint64_t mCurrentTime;
32 };
33 } // namespace MNN
34 
35 #ifdef MNN_OPEN_TIME_TRACE
36 #define AUTOTIME MNN::AutoTime ___t(__LINE__, __func__)
37 #else
38 #define AUTOTIME
39 #endif
40 
41 #endif /* AutoTime_hpp */
#define MNN_PUBLIC
Definition: MNNDefine.h:53
Definition: AutoTime.hpp:19
Definition: AutoTime.hpp:16