From 4c8531b642c579e69c27a8920c1aacbee04260c9 Mon Sep 17 00:00:00 2001 From: Björn Jacke Date: Mon, 30 Aug 2010 18:58:20 +0200 Subject: s4/torture: use monotonic clock for time deltas in denytest --- source4/torture/basic/denytest.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/source4/torture/basic/denytest.c b/source4/torture/basic/denytest.c index 174a1b2d6c..7480c388ae 100644 --- a/source4/torture/basic/denytest.c +++ b/source4/torture/basic/denytest.c @@ -1416,7 +1416,7 @@ bool torture_denytest1(struct torture_context *tctx, int fnum1, fnum2; int i; bool correct = true; - struct timeval tv, tv_start; + struct timespec tv, tv_start; const char *fnames[2] = {"\\denytest1.dat", "\\denytest1.exe"}; int failures=0; @@ -1431,7 +1431,7 @@ bool torture_denytest1(struct torture_context *tctx, torture_comment(tctx, "Testing %d entries\n", (int)ARRAY_SIZE(denytable1)); - GetTimeOfDay(&tv_start); + clock_gettime_mono(&tv_start); for (i=0; itree, fnum1); } - GetTimeOfDay(&tv_start); + clock_gettime_mono(&tv_start); for (i=0; itree, fnum1, 0, buf, 0, sizeof(buf)); smbcli_close(cli1->tree, fnum1); - GetTimeOfDay(&tv_start); + clock_gettime_mono(&tv_start); io1.ntcreatex.level = RAW_OPEN_NTCREATEX; io1.ntcreatex.in.root_fid.fnum = 0; @@ -1871,9 +1871,9 @@ static bool torture_ntdenytest(struct torture_context *tctx, read_for_execute, &res2); - GetTimeOfDay(&tv); - tdif = usec_time_diff(&tv, &tv_start); - tdif /= 1000; + clock_gettime_mono(&tv); + tdif = nsec_time_diff(&tv, &tv_start); + tdif /= 1000000; if (torture_setting_bool(tctx, "showall", false) || !NT_STATUS_EQUAL(status2, status2_p) || res != res2) { -- cgit