diff 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
line wrap: on
line diff
--- a/include/core/time.h	Mon May 13 17:02:35 2024 -0400
+++ b/include/core/time.h	Sun May 19 15:56:20 2024 -0400
@@ -5,19 +5,17 @@
 #include <string>
 namespace Time {
 
-class Duration {
-public:
-	Duration(int64_t l);
-	int64_t InSeconds();
-	int64_t InMinutes();
-	int64_t InHours();
-	int64_t InDays();
-	std::string AsRelativeString();
+/* this is in SECONDS */
+using Timestamp = uint64_t;
 
-private:
-	int64_t length;
+enum class Units {
+	Seconds,
+	Minutes
 };
 
+std::string GetSecondsAsRelativeString(Timestamp length);
+std::string GetSecondsAsAbsoluteString(Units unit_cutoff, Timestamp amount, double unit_in_seconds = 1.0);
+
 int64_t GetSystemTime();
 
 }; // namespace Time