summaryrefslogtreecommitdiff
path: root/source4/lib/ldb
diff options
context:
space:
mode:
authorBjörn Jacke <bj@sernet.de>2010-08-30 18:54:42 +0200
committerBjörn Jacke <bj@sernet.de>2010-08-31 10:26:36 +0200
commit60002600b86808551df0fb9b907869590b670450 (patch)
treeaddfb2075b6e969aacbd35cd076ee20c84641fc4 /source4/lib/ldb
parent8aa0b709d4924262c73c96d54bc0a28fa8b8aff0 (diff)
downloadsamba-60002600b86808551df0fb9b907869590b670450.tar.gz
samba-60002600b86808551df0fb9b907869590b670450.tar.bz2
samba-60002600b86808551df0fb9b907869590b670450.zip
s4/ldb: use monotonic clock for time deltas in ldbtest
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r--source4/lib/ldb/tools/ldbtest.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source4/lib/ldb/tools/ldbtest.c b/source4/lib/ldb/tools/ldbtest.c
index b76889c61f..a885b80c72 100644
--- a/source4/lib/ldb/tools/ldbtest.c
+++ b/source4/lib/ldb/tools/ldbtest.c
@@ -40,19 +40,19 @@
#include "ldb.h"
#include "tools/cmdline.h"
-static struct timeval tp1,tp2;
+static struct timespec tp1,tp2;
static struct ldb_cmdline *options;
static void _start_timer(void)
{
- gettimeofday(&tp1,NULL);
+ clock_gettime_mono(&tp1);
}
static double _end_timer(void)
{
- gettimeofday(&tp2,NULL);
+ clock_gettime_mono(&tp2);
return((tp2.tv_sec - tp1.tv_sec) +
- (tp2.tv_usec - tp1.tv_usec)*1.0e-6);
+ (tp2.tv_nsec - tp1.tv_nsec)*1.0e-9);
}
static void add_records(struct ldb_context *ldb,