projects
/
matthijs
/
ABM2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* Don't sleep for negative amounts (overflows to very large sleep delays :-)
[matthijs/ABM2.git]
/
ABM2
/
Engine
/
Kernel.cpp
diff --git
a/ABM2/Engine/Kernel.cpp
b/ABM2/Engine/Kernel.cpp
index 06269d33183bbd209f78b2b1967a317ab654f98b..35d4afce603cc425a1fe83b2275477380459315b 100755
(executable)
--- a/
ABM2/Engine/Kernel.cpp
+++ b/
ABM2/Engine/Kernel.cpp
@@
-67,7
+67,9
@@
int CKernel::Execute()
}
\r
IMMObject::CollectGarbage();
\r
DWORD end_point = GetTickCount();
\r
}
\r
IMMObject::CollectGarbage();
\r
DWORD end_point = GetTickCount();
\r
- Sleep(50 - (end_point-starting_point));
\r
+ /* Sleep if we didn't use up too much time already */
\r
+ if (starting_point + 50 > end_point)
\r
+ Sleep(50 - (end_point-starting_point));
\r
}
\r
#ifdef _DEBUG
\r
CProfileSample::Output();
\r
}
\r
#ifdef _DEBUG
\r
CProfileSample::Output();
\r