diff options
author | Stefan Metzmacher <metze@samba.org> | 2009-11-24 10:36:52 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2009-11-24 11:47:31 +0100 |
commit | 14d2ca26b3abd0feb20f270c66847b7b2c17cb0a (patch) | |
tree | 351da08fa67f684923abdec30c177fdc6efcba68 /source3 | |
parent | 23d81904ebafffebec803c2e43bc645dedc88f8e (diff) | |
download | samba-14d2ca26b3abd0feb20f270c66847b7b2c17cb0a.tar.gz samba-14d2ca26b3abd0feb20f270c66847b7b2c17cb0a.tar.bz2 samba-14d2ca26b3abd0feb20f270c66847b7b2c17cb0a.zip |
s3:dbwrap_torture: use timeval_current/timeval_elapsed instead of start_timer/end_timer
metze
Diffstat (limited to 'source3')
-rw-r--r-- | source3/utils/dbwrap_torture.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/source3/utils/dbwrap_torture.c b/source3/utils/dbwrap_torture.c index 2077eea567..a6e2d2bc2c 100644 --- a/source3/utils/dbwrap_torture.c +++ b/source3/utils/dbwrap_torture.c @@ -33,20 +33,6 @@ extern bool AllowDebugChange; -static struct timeval tp1,tp2; - -static void start_timer(void) -{ - gettimeofday(&tp1,NULL); -} - -static double end_timer(void) -{ - gettimeofday(&tp2,NULL); - return (tp2.tv_sec + (tp2.tv_usec*1.0e-6)) - - (tp1.tv_sec + (tp1.tv_usec*1.0e-6)); -} - #define DEFAULT_DB_NAME "transaction.tdb" static int timelimit = 10; @@ -138,12 +124,13 @@ static void test_store_records(struct db_context *db, struct tevent_context *ev) TDB_DATA key; uint32_t *counters; TALLOC_CTX *tmp_ctx = talloc_stackframe(); + struct timeval start; key.dptr = (unsigned char *)discard_const("testkey"); key.dsize = strlen((const char *)key.dptr)+1; - start_timer(); - while ((timelimit == 0) || (end_timer() < timelimit)) { + start = timeval_current(); + while ((timelimit == 0) || (timeval_elapsed(&start) < timelimit)) { struct db_record *rec; TDB_DATA data; int ret; |