summaryrefslogtreecommitdiff
path: root/src/common/timer.h
diff options
context:
space:
mode:
authorGravatar bunnei2014-04-08 19:25:03 -0400
committerGravatar bunnei2014-04-08 19:25:03 -0400
commit63e46abdb8764bc97e91bae862c8d461e61b1965 (patch)
treee73f4aa25d7b4015a265e7bbfb6004dab7561027 /src/common/timer.h
parentfixed some license headers that I missed (diff)
downloadyuzu-63e46abdb8764bc97e91bae862c8d461e61b1965.tar.gz
yuzu-63e46abdb8764bc97e91bae862c8d461e61b1965.tar.xz
yuzu-63e46abdb8764bc97e91bae862c8d461e61b1965.zip
got rid of 'src' folders in each sub-project
Diffstat (limited to 'src/common/timer.h')
-rw-r--r--src/common/timer.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/common/timer.h b/src/common/timer.h
new file mode 100644
index 000000000..20c86762a
--- /dev/null
+++ b/src/common/timer.h
@@ -0,0 +1,46 @@
1// Copyright 2013 Dolphin Emulator Project
2// Licensed under GPLv2
3// Refer to the license.txt file included.
4
5#ifndef _TIMER_H_
6#define _TIMER_H_
7
8#include "common.h"
9#include <string>
10
11namespace Common
12{
13class Timer
14{
15public:
16 Timer();
17
18 void Start();
19 void Stop();
20 void Update();
21
22 // The time difference is always returned in milliseconds, regardless of alternative internal representation
23 u64 GetTimeDifference();
24 void AddTimeDifference();
25
26 static void IncreaseResolution();
27 static void RestoreResolution();
28 static u64 GetTimeSinceJan1970();
29 static u64 GetLocalTimeSinceJan1970();
30 static double GetDoubleTime();
31
32 static std::string GetTimeFormatted();
33 std::string GetTimeElapsedFormatted() const;
34 u64 GetTimeElapsed();
35
36 static u32 GetTimeMs();
37
38private:
39 u64 m_LastTime;
40 u64 m_StartTime;
41 bool m_Running;
42};
43
44} // Namespace Common
45
46#endif // _TIMER_H_