⏱️ golxzn::os::chrono ⏱️
1.2.4
Chrono for golxzn's projects.
Loading...
Searching...
No Matches
chrono.hpp
Go to the documentation of this file.
1
/**
2
* @file golxzn/os/chrono.hpp
3
* @author Ruslan Golovinskii (golxzn@gmail.com)
4
* @brief Main header for golxzn::os::chrono
5
* @date 2023-10-24
6
*
7
* @copyright Copyright (c) 2023
8
*
9
* @defgroup golxzn::os::chrono Chrono
10
*
11
* Description
12
* -------------
13
*
14
* This file is the common header to include all the functionality of golxzn::os::chrono.
15
* It includes the following classes:
16
* - [golxzn::os::chrono::time](@ref golxzn::os::chrono::time)
17
* - [golxzn::os::chrono::fast_clock](@ref golxzn::os::chrono::fast_clock)
18
* - [golxzn::os::chrono::clock](@ref golxzn::os::chrono::clock)
19
* - [golxzn::os::chrono::fast_timer](@ref golxzn::os::chrono::fast_timer)
20
* - [golxzn::os::chrono::timer](@ref golxzn::os::chrono::timer)
21
*
22
* Diagram
23
* -------------
24
*
25
* ```plantuml
26
* @startuml
27
* !theme crt-amber
28
* title golxzn chrono classes
29
*
30
* namespace golxzn::os::chrono {
31
* class time {
32
* + seconds() const noexcept : float|double
33
* + milliseconds() const noexcept : i32
34
* + microseconds() const noexcept : i64
35
* + duration() const noexcept : std::chrono::microseconds
36
* {static} + zero() noexcept : time
37
* {static} + now() noexcept : time
38
* }
39
*
40
* class fast_clock {
41
* + elapsed() noexcept : time
42
* }
43
* class clock {
44
* + running() const noexcept : bool
45
* + elapsed() noexcept : time
46
* + restart() noexcept : time
47
* + reset() noexcept : time
48
* + start() noexcept : void
49
* + stop() noexcept : void
50
* }
51
*
52
* class fast_timer {
53
* + constructor(interval)
54
* + is_done() const noexcept : bool
55
* + is_running() const noexcept : bool
56
* + time_left() const noexcept : time
57
* }
58
* class timer {
59
* + constructor(interval, callback)
60
* + is_done() const noexcept : bool
61
* + is_running() const noexcept : bool
62
* + time_left() const noexcept : time
63
* }
64
*
65
* time <.. fast_clock
66
* time <.. clock
67
* time <.. fast_timer
68
* time <.. timer:now
69
* }
70
*
71
* @enduml
72
* ```
73
*/
74
75
#pragma once
76
77
#include <
golxzn/os/chrono/time.hpp
>
78
#include <
golxzn/os/chrono/clock.hpp
>
79
#include <
golxzn/os/chrono/timer.hpp
>
80
81
namespace
gxzn = golxzn;
82
83
#if defined(GOLXZN_USE_GLOBAL_NAMES)
84
namespace
golxzn {
using namespace
os; }
// namespace golxzn
85
#endif
// defined(GOLXZN_USE_GLOBAL_NAMES)
clock.hpp
Clock classes to measure elapsed time.
time.hpp
Class that represents time.
timer.hpp
Timer classes to measure time intervals.
golxzn
os
chrono.hpp
Generated by
1.9.7