summaryrefslogtreecommitdiffstats
path: root/util/system
diff options
context:
space:
mode:
authorrzhikharevich <[email protected]>2022-02-10 16:51:00 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:51:00 +0300
commit3fd404e3c028261bd5c6720cd67d4b755740d161 (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /util/system
parent724861a587a9d8ecec238aec4c37154e3f2409bb (diff)
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'util/system')
-rw-r--r--util/system/datetime.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/util/system/datetime.cpp b/util/system/datetime.cpp
index ad2c8c376fd..b07b50679a6 100644
--- a/util/system/datetime.cpp
+++ b/util/system/datetime.cpp
@@ -8,15 +8,15 @@
#include <ctime>
#include <cerrno>
-#ifdef _darwin_
+#ifdef _darwin_
#include <AvailabilityMacros.h>
#if defined(MAC_OS_X_VERSION_10_12) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
#define Y_HAS_CLOCK_GETTIME
#endif
-#elif defined(_linux_) || defined(_freebsd_) || defined(_cygwin_)
+#elif defined(_linux_) || defined(_freebsd_) || defined(_cygwin_)
#define Y_HAS_CLOCK_GETTIME
-#endif
-
+#endif
+
static ui64 ToMicroSeconds(const struct timeval& tv) {
return (ui64)tv.tv_sec * 1000000 + (ui64)tv.tv_usec;
}
@@ -25,10 +25,10 @@ static ui64 ToMicroSeconds(const struct timeval& tv) {
static ui64 ToMicroSeconds(const FILETIME& ft) {
return (((ui64)ft.dwHighDateTime << 32) + (ui64)ft.dwLowDateTime) / (ui64)10;
}
-#elif defined(Y_HAS_CLOCK_GETTIME)
-static ui64 ToMicroSeconds(const struct timespec& ts) {
- return (ui64)ts.tv_sec * 1000000 + (ui64)ts.tv_nsec / 1000;
-}
+#elif defined(Y_HAS_CLOCK_GETTIME)
+static ui64 ToMicroSeconds(const struct timespec& ts) {
+ return (ui64)ts.tv_sec * 1000000 + (ui64)ts.tv_nsec / 1000;
+}
#endif
ui64 MicroSeconds() noexcept {
@@ -63,12 +63,12 @@ ui64 ThreadCPUTime() noexcept {
FILETIME creationTime, exitTime, kernelTime, userTime;
GetThreadTimes(GetCurrentThread(), &creationTime, &exitTime, &kernelTime, &userTime);
return ToMicroSeconds(userTime) + ToMicroSeconds(kernelTime);
-#elif defined(Y_HAS_CLOCK_GETTIME)
+#elif defined(Y_HAS_CLOCK_GETTIME)
struct timespec ts;
clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts);
return ToMicroSeconds(ts);
-#else
- return 0;
+#else
+ return 0;
#endif
}
@@ -97,7 +97,7 @@ void NanoSleep(ui64 ns) noexcept {
#if defined(_x86_)
extern const bool HaveRdtscp = NX86::HaveRDTSCP();
#endif
-
-#ifdef Y_HAS_CLOCK_GETTIME
+
+#ifdef Y_HAS_CLOCK_GETTIME
#undef Y_HAS_CLOCK_GETTIME
-#endif
+#endif