summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2024-03-18 11:13:46 +0000
committerSadie Powell <sadie@witchery.services>2024-03-18 11:27:10 +0000
commitcb3848b7dbb7eeb809898b2fccab3ff2f0696e6e (patch)
treed40832e33a9918965869902f517837e90e752c76 /include
parent753119c4a16f6dafacbeb3d98fe72133badca949 (diff)
Use clock_gettime if it is available.
Diffstat (limited to 'include')
-rw-r--r--include/anope.h4
-rw-r--r--include/sysconf.h.cmake3
2 files changed, 7 insertions, 0 deletions
diff --git a/include/anope.h b/include/anope.h
index 819de40ee..91d073133 100644
--- a/include/anope.h
+++ b/include/anope.h
@@ -367,6 +367,7 @@ namespace Anope
* Use this unless you need very specific time checks
*/
extern CoreExport time_t CurTime;
+ extern CoreExport long long CurTimeNs;
/** The debug level we are running at.
*/
@@ -575,6 +576,9 @@ namespace Anope
* @param s2 The second string.
*/
extern CoreExport size_t Distance(const Anope::string &s1, const Anope::string &s2);
+
+ /** Update the current time. */
+ extern CoreExport void UpdateTime();
}
/** sepstream allows for splitting token separated lists.
diff --git a/include/sysconf.h.cmake b/include/sysconf.h.cmake
index 8c1a35e72..927c75910 100644
--- a/include/sysconf.h.cmake
+++ b/include/sysconf.h.cmake
@@ -20,6 +20,9 @@
// Whether Anope was built in debug mode.
#cmakedefine01 DEBUG_BUILD
+// Whether the clock_gettime() function is available.
+#cmakedefine01 HAVE_CLOCK_GETTIME
+
// Whether Anope was built with localization support.
#cmakedefine01 HAVE_LOCALIZATION