Files
dolphin/Source/Core/Common/Timer.h
T

44 lines
838 B
C++
Raw Normal View History

// Copyright 2013 Dolphin Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.
2008-12-08 04:46:09 +00:00
#pragma once
2008-12-08 04:46:09 +00:00
2009-01-15 11:46:09 +00:00
#include <string>
2014-02-17 05:18:15 -05:00
#include "Common/CommonTypes.h"
2010-01-21 19:55:01 +00:00
2008-12-08 04:46:09 +00:00
namespace Common
{
class Timer
{
public:
Timer();
2008-12-08 04:46:09 +00:00
void Start();
void Stop();
void Update();
2008-12-08 04:46:09 +00:00
// The time difference is always returned in milliseconds, regardless of alternative internal representation
u64 GetTimeDifference();
void AddTimeDifference();
2008-12-08 04:46:09 +00:00
static void IncreaseResolution();
static void RestoreResolution();
static u64 GetTimeSinceJan1970();
static u64 GetLocalTimeSinceJan1970();
static double GetDoubleTime();
2008-12-08 04:46:09 +00:00
static std::string GetTimeFormatted();
std::string GetTimeElapsedFormatted() const;
u64 GetTimeElapsed();
2008-12-08 04:46:09 +00:00
2010-01-21 19:55:01 +00:00
static u32 GetTimeMs();
private:
u64 m_LastTime;
u64 m_StartTime;
bool m_Running;
2008-12-08 04:46:09 +00:00
};
2009-03-28 08:57:34 +00:00
} // Namespace Common