MCPcopy Create free account
hub / github.com/alibaba/MNN / getTime

Function getTime

tools/cpp/Profiler.cpp:26–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24namespace MNN {
25
26static inline int64_t getTime() {
27 uint64_t time;
28#if defined(_MSC_VER)
29 LARGE_INTEGER now, freq;
30 QueryPerformanceCounter(&now);
31 QueryPerformanceFrequency(&freq);
32 uint64_t sec = now.QuadPart / freq.QuadPart;
33 uint64_t usec = (now.QuadPart % freq.QuadPart) * 1000000 / freq.QuadPart;
34 time = sec * 1000000 + usec;
35#else
36 struct timeval tv;
37 gettimeofday(&tv, nullptr);
38 time = static_cast<uint64_t>(tv.tv_sec) * 1000000 + tv.tv_usec;
39#endif
40 return time;
41}
42
43static std::string toString(float value) {
44 char typeString[100] = {};

Callers 2

startMethod · 0.85
endMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected