From cb3848b7dbb7eeb809898b2fccab3ff2f0696e6e Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 18 Mar 2024 11:13:46 +0000 Subject: Use clock_gettime if it is available. --- include/anope.h | 4 ++++ include/sysconf.h.cmake | 3 +++ 2 files changed, 7 insertions(+) (limited to 'include') 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 -- cgit