Browse Source

Add system::sleep().

tags/v2.2.0
Andrew Belt 2 years ago
parent
commit
a6a212789a
2 changed files with 6 additions and 0 deletions
  1. +1
    -0
      include/system.hpp
  2. +5
    -0
      src/system.cpp

+ 1
- 0
include/system.hpp View File

@@ -171,6 +171,7 @@ double getTime();
*/
double getUnixTime();
double getThreadTime();
void sleep(double time);
std::string getOperatingSystemInfo();

// Applications


+ 5
- 0
src/system.cpp View File

@@ -809,6 +809,11 @@ double getThreadTime() {
}


void sleep(double time) {
std::this_thread::sleep_for(std::chrono::duration<double>(time));
}


std::string getOperatingSystemInfo() {
#if defined ARCH_LIN
struct utsname u;


Loading…
Cancel
Save