MCPcopy Create free account
hub / github.com/cameron314/concurrentqueue / getTimeDelta

Function getTimeDelta

tests/common/systemtime.cpp:38–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38double getTimeDelta(SystemTime start)
39{
40 LARGE_INTEGER t;
41 CompilerMemBar();
42 if (start == static_cast<SystemTime>(-1) || !QueryPerformanceCounter(&t)) {
43 return -1;
44 }
45 CompilerMemBar();
46
47 auto now = static_cast<SystemTime>(t.QuadPart);
48
49 LARGE_INTEGER f;
50 if (!QueryPerformanceFrequency(&f)) {
51 return -1;
52 }
53
54#if defined(__GNUC__)
55#pragma GCC diagnostic push
56#pragma GCC diagnostic ignored "-Wconversion"
57#endif
58 return static_cast<double>(static_cast<__int64>(now - start)) / f.QuadPart * 1000;
59#if defined(__GNUC__)
60#pragma GCC diagnostic pop
61#endif
62}
63
64} // end namespace moodycamel
65

Callers 2

runBenchmarkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected