Mercurial > minori
annotate include/core/time.h @ 305:91ac90a34003
core/time: remove Duration class, use regular functions instead
this class was pretty useless anyway
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Sun, 19 May 2024 15:56:20 -0400 |
parents | 3ec7804abf17 |
children | da2c5a8ff306 |
rev | line source |
---|---|
261
3ec7804abf17
include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents:
258
diff
changeset
|
1 #ifndef MINORI_CORE_TIME_H_ |
3ec7804abf17
include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents:
258
diff
changeset
|
2 #define MINORI_CORE_TIME_H_ |
85 | 3 |
9 | 4 #include <cstdint> |
5 #include <string> | |
6 namespace Time { | |
7 | |
305
91ac90a34003
core/time: remove Duration class, use regular functions instead
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
8 /* this is in SECONDS */ |
91ac90a34003
core/time: remove Duration class, use regular functions instead
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
9 using Timestamp = uint64_t; |
9 | 10 |
305
91ac90a34003
core/time: remove Duration class, use regular functions instead
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
11 enum class Units { |
91ac90a34003
core/time: remove Duration class, use regular functions instead
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
12 Seconds, |
91ac90a34003
core/time: remove Duration class, use regular functions instead
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
13 Minutes |
9 | 14 }; |
15 | |
305
91ac90a34003
core/time: remove Duration class, use regular functions instead
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
16 std::string GetSecondsAsRelativeString(Timestamp length); |
91ac90a34003
core/time: remove Duration class, use regular functions instead
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
17 std::string GetSecondsAsAbsoluteString(Units unit_cutoff, Timestamp amount, double unit_in_seconds = 1.0); |
91ac90a34003
core/time: remove Duration class, use regular functions instead
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
18 |
9 | 19 int64_t GetSystemTime(); |
20 | |
85 | 21 }; // namespace Time |
22 | |
261
3ec7804abf17
include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents:
258
diff
changeset
|
23 #endif // MINORI_CORE_TIME_H_ |