We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1111170 commit faaa1f0Copy full SHA for faaa1f0
src/util/time.h
@@ -10,6 +10,14 @@
10
#include <string>
11
#include <chrono>
12
13
+/**
14
+ * Helper to count the seconds of a duration.
15
+ *
16
+ * All durations should be using std::chrono and calling this should generally be avoided in code. Though, it is still
17
+ * preferred to an inline t.count() to protect against a reliance on the exact type of t.
18
+ */
19
+inline int64_t count_seconds(std::chrono::seconds t) { return t.count(); }
20
+
21
/**
22
* DEPRECATED
23
* Use either GetSystemTimeInSeconds (not mockable) or GetTime<T> (mockable)
0 commit comments