| 36 | } |
| 37 | |
| 38 | double 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 |
no outgoing calls
no test coverage detected