annotate include/core/time.h @ 311:fb0f6b5050ff

linux: add required blank svg icon (???)
author Paper <paper@paper.us.eu.org>
date Tue, 11 Jun 2024 13:08:41 -0400
parents da2c5a8ff306
children d928ec7b6a0d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
c69230dc2b5d *: cleanup includes
Paper <mrpapersonic@gmail.com>
parents: 36
diff changeset
3
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
4 #include <cstdint>
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
5 #include <string>
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
6 namespace Time {
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
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 */
308
da2c5a8ff306 time: don't use time_t!
Paper <paper@paper.us.eu.org>
parents: 305
diff changeset
9 using Timestamp = int64_t;
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
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
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
14 };
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
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
308
da2c5a8ff306 time: don't use time_t!
Paper <paper@paper.us.eu.org>
parents: 305
diff changeset
19 /* in UTC */
da2c5a8ff306 time: don't use time_t!
Paper <paper@paper.us.eu.org>
parents: 305
diff changeset
20 Timestamp GetSystemTime();
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
21
85
c69230dc2b5d *: cleanup includes
Paper <mrpapersonic@gmail.com>
parents: 36
diff changeset
22 }; // namespace Time
c69230dc2b5d *: cleanup includes
Paper <mrpapersonic@gmail.com>
parents: 36
diff changeset
23
261
3ec7804abf17 include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
24 #endif // MINORI_CORE_TIME_H_