Nebula
Loading...
Searching...
No Matches
time.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
12#include "core/types.h"
13
14//------------------------------------------------------------------------------
15namespace Timing
16{
18typedef double Time;
20typedef int Tick;
21
22//------------------------------------------------------------------------------
26inline Time
28{
29 return ticks * 0.001;
30}
31
32//------------------------------------------------------------------------------
36inline Tick
38{
39 // perform correct rounding
40 return Tick((t * 1000.0) + 0.5);
41}
42
43//------------------------------------------------------------------------------
47inline void
49{
50 n_sleep(t);
51}
52
53};
54//------------------------------------------------------------------------------
void n_sleep(double sec)
Put process to sleep.
Definition debug.cc:239
Definition calendartimebase.h:19
Tick SecondsToTicks(Time t)
Convert seconds to ticks.
Definition time.h:37
int Tick
the tick datatype (one tick == 1 millisecond)
Definition time.h:20
void Sleep(Time t)
Put current thread to sleep for specified amount of seconds.
Definition time.h:48
double Time
the time datatype
Definition time.h:18
Time TicksToSeconds(Tick ticks)
Convert ticks to seconds.
Definition time.h:27