summaryrefslogtreecommitdiff
path: root/src/utils.h
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2023-07-15 11:43:41 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2023-07-15 11:43:41 +0200
commit83e6235919e649b45d36ebdc0eedc2d8d0ce309e (patch)
treea8069fd5d9a1e4e8088a1f1b0583b3b87b2d8706 /src/utils.h
parentbe6cfef7d259af98eda694537a85e692afa97aa1 (diff)
Minor changes
Diffstat (limited to 'src/utils.h')
-rw-r--r--src/utils.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/utils.h b/src/utils.h
index 5acdedc..01e0c33 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -13,13 +13,13 @@
#define STR(symbol) #symbol
#define STRINGIFY(symbol) STR(symbol)
-#define INTERVAL(timestamp,duration)\
- ((timestamp) - ((timestamp)%(duration)))
+#define TIMESTAMP() (time(NULL))
-#define INTERVAL_LAST(timestamp,duration)\
- (INTERVAL(INTERVAL((timestamp),(duration))-1,(duration)))
+#define INTERVAL(duration)\
+ ((TIMESTAMP()) - ((TIMESTAMP())%(duration)))
-#define TIMESTAMP() (time(NULL))
+#define INTERVAL_LAST(duration)\
+ (INTERVAL(INTERVAL((TIMESTAMP()),(duration))-1,(duration)))
#define FILE_EXISTS(path) (access((path), F_OK) == 0)