diff options
author | deva <deva> | 2005-09-18 14:34:10 +0000 |
---|---|---|
committer | deva <deva> | 2005-09-18 14:34:10 +0000 |
commit | 8e52138ba8a6fe9b92192512ba510451a2655384 (patch) | |
tree | 401a2e63ca122e898e91fb8dedb71fc39755f850 /src/util.cc | |
parent | a37c83d8c536ef6dd53b130e92022b04e8559f5b (diff) |
*** empty log message ***
Diffstat (limited to 'src/util.cc')
-rw-r--r-- | src/util.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/util.cc b/src/util.cc index a3fdd1c..b9d57ad 100644 --- a/src/util.cc +++ b/src/util.cc @@ -38,6 +38,9 @@ #include <string.h> #include <assert.h> +// For nanosleep +#include <time.h> + #include "util.h" void *xmalloc(size_t s) @@ -68,3 +71,14 @@ void *xrealloc(void *b, size_t s) } return p; } + +void sleep_1_frame() +{ + // Sleep 1/25th of a second + + struct timespec ts; + + ts.tv_sec = 0; + ts.tv_nsec = 1000000000L / 25L; // 1000ms / 25 + nanosleep(&ts, NULL); +} |