Commit e16c943b authored by Michael Tremer's avatar Michael Tremer

database: Print timings in milliseconds

We are so fast that seconds do not make any sense.
Signed-off-by: default avatarMichael Tremer <michael.tremer@ipfire.org>
parent 8b6197b8
...@@ -259,8 +259,8 @@ static int loc_database_read(struct loc_database* db, FILE* f) { ...@@ -259,8 +259,8 @@ static int loc_database_read(struct loc_database* db, FILE* f) {
clock_t end = clock(); clock_t end = clock();
INFO(db->ctx, "Opened database in %.8fs\n", INFO(db->ctx, "Opened database in %.4fms\n",
(double)(end - start) / CLOCKS_PER_SEC); (double)(end - start) / CLOCKS_PER_SEC * 1000);
return 0; return 0;
} }
...@@ -323,7 +323,6 @@ static void loc_database_free(struct loc_database* db) { ...@@ -323,7 +323,6 @@ static void loc_database_free(struct loc_database* db) {
ERROR(db->ctx, "Could not unmap network nodes section: %s\n", strerror(errno)); ERROR(db->ctx, "Could not unmap network nodes section: %s\n", strerror(errno));
} }
if (db->pool)
loc_stringpool_unref(db->pool); loc_stringpool_unref(db->pool);
loc_unref(db->ctx); loc_unref(db->ctx);
...@@ -404,8 +403,8 @@ LOC_EXPORT int loc_database_get_as(struct loc_database* db, struct loc_as** as, ...@@ -404,8 +403,8 @@ LOC_EXPORT int loc_database_get_as(struct loc_database* db, struct loc_as** as,
clock_t end = clock(); clock_t end = clock();
// Log how fast this has been // Log how fast this has been
DEBUG(db->ctx, "Found AS%u in %.8fs\n", as_number, DEBUG(db->ctx, "Found AS%u in %.4fms\n", as_number,
(double)(end - start) / CLOCKS_PER_SEC); (double)(end - start) / CLOCKS_PER_SEC * 1000);
return 0; return 0;
} }
...@@ -553,8 +552,8 @@ LOC_EXPORT int loc_database_lookup(struct loc_database* db, ...@@ -553,8 +552,8 @@ LOC_EXPORT int loc_database_lookup(struct loc_database* db,
clock_t end = clock(); clock_t end = clock();
// Log how fast this has been // Log how fast this has been
DEBUG(db->ctx, "Executed network search in %.8fs\n", DEBUG(db->ctx, "Executed network search in %.4fms\n",
(double)(end - start) / CLOCKS_PER_SEC); (double)(end - start) / CLOCKS_PER_SEC * 1000);
return r; return r;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment