Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void AwesomO::Sleep(unsigned long miliseconds) throw(...)
- {
- unsigned long remaining = miliseconds;
- clock_t t1=clock();
- clock_t t2;
- while (remaining > 0)
- {
- t2=clock();
- //Chat("T2-T1: %u", (t2-t1));
- if ((t2-t1) >= miliseconds)
- break;
- if (remaining >= 10)
- {
- ::Sleep(10);
- remaining -= 10;
- }
- else if (remaining < 10)
- {
- ::Sleep(remaining);
- remaining -= remaining;
- }
- Tasks();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment