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