From 4de984bdb89927e06764a79670c0580f704ab607 Mon Sep 17 00:00:00 2001 From: Brett Date: Sat, 16 Dec 2023 02:37:24 -0500 Subject: [PATCH] emscript on system.h --- include/blt/std/system.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/include/blt/std/system.h b/include/blt/std/system.h index 168b9eb..960521e 100755 --- a/include/blt/std/system.h +++ b/include/blt/std/system.h @@ -7,10 +7,14 @@ #ifndef BLT_SYSTEM_H #define BLT_SYSTEM_H -#ifdef _WIN32 -#include +#ifndef __EMSCRIPTEN__ + #ifdef _WIN32 + #include + #else + #include + #endif #else -#include + #include #endif #include @@ -21,7 +25,11 @@ namespace blt::system { // #define GNU_INLINE //#endif inline std::uint64_t rdtsc(){ +#ifdef __EMSCRIPTEN__ + return std::chrono::high_resolution_clock::now().time_since_epoch().count(); +#else return __rdtsc(); +#endif } // TODO: system memory and current CPU usage. (Linux Only currently)