summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBalint Reczey <balint@balintreczey.hu>2013-09-04 13:05:04 +0200
committerWolfgang Hommel <wolfgang.hommel@lrz.de>2013-09-05 10:26:57 +0200
commit545685e5a89da2fe68183227d9dc2c10c75d0656 (patch)
treeef66e4a753b46348dd7fb51efeacb783501d6d05 /test
parent3f4563fd92d65600b7727ab51282560881c8fd40 (diff)
downloadfaketime-ng-545685e5a89da2fe68183227d9dc2c10c75d0656.tar.gz
Use nanosleep() in faked sleep() and usleep() to avoid rounding issues [rbalint/pr28]
Diffstat (limited to 'test')
-rw-r--r--test/timetest.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/timetest.c b/test/timetest.c
index be242e2..139d171 100644
--- a/test/timetest.c
+++ b/test/timetest.c
@@ -52,7 +52,8 @@ int main (int argc, char **argv) {
printf("(Intentionally sleeping 2 seconds...)\n");
fflush(stdout);
- sleep(2);
+ sleep(1);
+ usleep(1000000);
gettimeofday(&tv, NULL);
printf("gettimeofday() : Current date and time: %s", ctime(&tv.tv_sec));