Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkWindowsRealTimeClock.cpp
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
14 
15 #include "windows.h"
16 #include <chrono>
17 #include <ctime>
18 
19 
24 {
25  SetFrequency();
26 }
27 
32 {
33 
34 }
35 
37 {
38  if ( !QueryPerformanceFrequency(&m_Frequency) )
39  {
40  m_Frequency.QuadPart = 0;
41  }
42 }
43 
48 {
49  return std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::high_resolution_clock::now().time_since_epoch()).count();
50 }
51 
56 {
57  return this->m_Frequency;
58 }
virtual LARGE_INTEGER GetFrequency()
returns the QueryPerformanceFrequency
virtual double GetCurrentStamp()
returns the current time in milliseconds as a double
virtual ~WindowsRealTimeClock()
basic destructor
LARGE_INTEGER m_Frequency
Frequency needed to calculate time from tick-counter.