Nebula
Toggle main menu visibility
Loading...
Searching...
No Matches
posixtimer.h
Go to the documentation of this file.
1
#pragma once
2
#ifndef POSIX_POSIXTIMER_H
3
#define POSIX_POSIXTIMER_H
4
//------------------------------------------------------------------------------
19
#include "
core/types.h
"
20
#include "
timing/time.h
"
21
22
//------------------------------------------------------------------------------
23
namespace
Posix
24
{
25
class
PosixTimer
26
{
27
public
:
29
PosixTimer
();
31
void
Start
();
33
void
Stop
();
35
void
Reset
();
37
bool
Running
()
const
;
39
Timing::Time
GetTime
()
const
;
41
Timing::Tick
GetTicks
()
const
;
42
43
private
:
45
Timing::Time
InternalTime
()
const
;
46
47
Timing::Time
ToTime
(
const
timespec & ts)
const
;
48
49
bool
running
;
50
Timing::Time
diffTime
;
// accumulated time when the timer was not running
51
Timing::Time
stopTime
;
// when was the timer last stopped?
52
};
53
54
}
// namespace Posix
55
//------------------------------------------------------------------------------
56
#endif
57
Posix::PosixTimer::diffTime
Timing::Time diffTime
Definition
posixtimer.h:50
Posix::PosixTimer::Start
void Start()
start/continue the timer
Definition
posixtimer.cc:31
Posix::PosixTimer::GetTime
Timing::Time GetTime() const
get current time in seconds
Definition
posixtimer.cc:138
Posix::PosixTimer::GetTicks
Timing::Tick GetTicks() const
get current time in ticks
Definition
posixtimer.cc:149
Posix::PosixTimer::Running
bool Running() const
return true if currently running
Definition
posixtimer.cc:90
Posix::PosixTimer::running
bool running
Definition
posixtimer.h:49
Posix::PosixTimer::Reset
void Reset()
reset the timer
Definition
posixtimer.cc:70
Posix::PosixTimer::PosixTimer
PosixTimer()
constructor
Definition
posixtimer.cc:16
Posix::PosixTimer::Stop
void Stop()
stop the timer
Definition
posixtimer.cc:56
Posix::PosixTimer::InternalTime
Timing::Time InternalTime() const
return internal time
Definition
posixtimer.cc:110
Posix::PosixTimer::ToTime
Timing::Time ToTime(const timespec &ts) const
Convert timespec to Timing::Time.
Definition
posixtimer.cc:100
Posix::PosixTimer::stopTime
Timing::Time stopTime
Definition
posixtimer.h:51
Posix
Posix implemention of a read-many write-few lock.
Definition
posixsysfunc.cc:21
Timing::Tick
int Tick
the tick datatype (one tick == 1 millisecond)
Definition
time.h:20
Timing::Time
double Time
the time datatype
Definition
time.h:18
time.h
Typedefs for the Timing subsystem.
types.h
code
foundation
timing
posix
posixtimer.h
Generated on
for Nebula. Dark theme by
Tilen Majerle
. All rights reserved.