| 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 | return static_cast<double>(static_cast<__int64>(now - start)) / f.QuadPart * 1000; |
| 55 | } |
| 56 | |
| 57 | } // end namespace moodycamel |
| 58 |