z test patch

This commit is contained in:
h4570
2022-08-14 18:05:57 +02:00
parent a9c91db594
commit 15391a81e0
51 changed files with 197 additions and 163 deletions
+9 -2
View File
@@ -13,13 +13,20 @@
namespace Tyra {
timespec Threading::tv = {0, 0};
void Threading::sleep(const u32& ms) {
struct timespec tv = {0};
tv.tv_sec = ms / 1000;
tv.tv_nsec = (ms % 1000) * 1000000;
nanosleep(&tv, nullptr);
}
void Threading::switchThread() { sleep(1); }
void Threading::sleep(const timespec& t_tv) { nanosleep(&t_tv, nullptr); }
void Threading::switchThread() {
tv.tv_sec = 0;
tv.tv_nsec = 500000; // 1/2ms
nanosleep(&tv, nullptr);
}
} // Namespace Tyra