Leviathan  0.8.0.0
Leviathan game engine
TimeIncludes.h
Go to the documentation of this file.
1 // Leviathan Game Engine
2 // Copyright (c) 2012-2019 Henri Hyyryläinen
4 #pragma once
5 
6 #include "Include.h"
7 
8 #include <chrono>
9 #include <cstdint>
10 
11 namespace Leviathan {
12 
13 // Standard type time durations //
14 using MillisecondDuration = std::chrono::duration<int64_t, std::milli>;
15 using MicrosecondDuration = std::chrono::duration<int64_t, std::micro>;
16 using SecondDuration = std::chrono::duration<float, std::ratio<1>>;
17 using PreciseSecondDuration = std::chrono::duration<double, std::ratio<1>>;
18 
19 using WantedClockType = std::chrono::high_resolution_clock;
20 using TimePoint = WantedClockType::time_point;
21 
23 class Time {
24 public:
26  DLLEXPORT static int64_t GetTimeMs64();
27  DLLEXPORT static int64_t GetTimeMicro64();
28 
32 };
33 } // namespace Leviathan
std::chrono::duration< int64_t, std::micro > MicrosecondDuration
Definition: TimeIncludes.h:15
WantedClockType::time_point TimePoint
Definition: TimeIncludes.h:20
Helper class for getting the time.
Definition: TimeIncludes.h:23
std::chrono::duration< double, std::ratio< 1 > > PreciseSecondDuration
Definition: TimeIncludes.h:17
static DLLEXPORT int64_t GetTimeMs64()
static DLLEXPORT int64_t GetTimeMicro64()
std::chrono::duration< int64_t, std::milli > MillisecondDuration
Definition: TimeIncludes.h:14
static DLLEXPORT TimePoint GetCurrentTimePoint()
std::chrono::high_resolution_clock WantedClockType
Definition: TimeIncludes.h:19
#define DLLEXPORT
Definition: Include.h:84
The access mask controls which registered functions and classes a script sees.
Definition: GameModule.h:12
std::chrono::duration< float, std::ratio< 1 > > SecondDuration
Definition: TimeIncludes.h:16