Plasma Engine  2.0
Loading...
Searching...
No Matches
Time_Posix.h
1#include <Foundation/FoundationInternal.h>
2PL_FOUNDATION_INTERNAL_HEADER
3
4#include <Foundation/Time/Time.h>
5
6#include <time.h>
7
8void plTime::Initialize()
9{
10}
11
13{
14 struct timespec sp;
15 clock_gettime(CLOCK_MONOTONIC_RAW, &sp);
16
17 return plTime::MakeFromSeconds((double)sp.tv_sec + (double)(sp.tv_nsec / 1000000000.0));
18}
The time class encapsulates a double value storing the time in seconds.
Definition Time.h:12
PL_ALWAYS_INLINE static constexpr plTime MakeFromSeconds(double fSeconds)
Creates an instance of plTime that was initialized from seconds.
Definition Time.h:30
static plTime Now()
Gets the current time.
Definition Time_Posix.h:12