From b53bdc29418d946e6b479a153fc5714746c87283 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Thu, 4 Dec 2014 15:56:38 +0100 Subject: little cleanups in the test --- store/test/storagebenchmark.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'store') diff --git a/store/test/storagebenchmark.cpp b/store/test/storagebenchmark.cpp index 6f9f18b..3be90e9 100644 --- a/store/test/storagebenchmark.cpp +++ b/store/test/storagebenchmark.cpp @@ -94,7 +94,9 @@ private Q_SLOTS: for (int i = 0; i < count; i++) { if (db) { if (i % 10000 == 0) { - db->commitTransaction(); + if (i > 0) { + db->commitTransaction(); + } db->startTransaction(); } @@ -110,10 +112,9 @@ private Q_SLOTS: myfile.close(); } } - const int writeDuration = time.elapsed(); + const int writeDuration = time.restart(); qDebug() << "Writing took[ms]: " << writeDuration; - time.start(); { for (int i = 0; i < count; i++) { if (db) { @@ -121,13 +122,15 @@ private Q_SLOTS: } } } - const int readDuration = time.elapsed(); + const int readDuration = time.restart(); - if (useDb) { + if (db) { qDebug() << "Reading took[ms]: " << readDuration; } else { qDebug() << "File reading is not implemented."; } + + delete db; } void testBufferCreation() -- cgit v1.2.3