diff options
author | Eugenio Favalli <elvenprogrammer@gmail.com> | 2006-05-14 19:00:47 +0000 |
---|---|---|
committer | Eugenio Favalli <elvenprogrammer@gmail.com> | 2006-05-14 19:00:47 +0000 |
commit | 26d2810437fbfbb42225c47b358794008f94bc5e (patch) | |
tree | f23eb686ddf4f4c3ba4a086d1111b8120b9af636 /src | |
parent | 2bd503556d1074b3d42469413359034d00f954fd (diff) | |
download | manaserv-26d2810437fbfbb42225c47b358794008f94bc5e.tar.gz manaserv-26d2810437fbfbb42225c47b358794008f94bc5e.tar.bz2 manaserv-26d2810437fbfbb42225c47b358794008f94bc5e.tar.xz manaserv-26d2810437fbfbb42225c47b358794008f94bc5e.zip |
Replaced nanosleep with Sleep in Windows and updated Dev-C++ project file.
Diffstat (limited to 'src')
-rw-r--r-- | src/utils/timer.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/utils/timer.cpp b/src/utils/timer.cpp index 0e9a6a7e..a476ebec 100644 --- a/src/utils/timer.cpp +++ b/src/utils/timer.cpp @@ -39,10 +39,14 @@ void Timer::sleep() if (!active) return; uint64_t now = getTimeInMillisec(); if (now - lastpulse >= interval) return; +#ifndef _WIN32 struct timespec req; req.tv_sec = 0; req.tv_nsec = (interval - (now - lastpulse)) * (1000 * 1000); nanosleep(&req, 0); +#else + Sleep(interval - (now - lastpulse)); +#endif } int Timer::poll() |