summaryrefslogtreecommitdiff
path: root/src/search.cpp
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrikboy@gmail.com>2024-03-05 18:58:49 +0100
committerAldrik Ramaekers <aldrikboy@gmail.com>2024-03-05 18:58:49 +0100
commit6b492daddd682de986e3f983ecfc1d29ed70b0a0 (patch)
tree7ffffcc52e9b3f695f9cfd857b663ee16fc7dc07 /src/search.cpp
parent3979a2aaebacca290c9e6f7d2fee95b941aba32a (diff)
measure elapsed time for search
Diffstat (limited to 'src/search.cpp')
-rw-r--r--src/search.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/search.cpp b/src/search.cpp
index 1e7241c..93cb9e9 100644
--- a/src/search.cpp
+++ b/src/search.cpp
@@ -98,6 +98,7 @@ ts_search_result *ts_create_empty_search_result()
new_result_buffer->max_file_size = megabytes(1000);
new_result_buffer->memory = ts_memory_bucket_init(megabytes(1));
new_result_buffer->prev_result = current_search_result;
+ new_result_buffer->timestamp = ts_platform_get_time();
new_result_buffer->files = ts_array_create(sizeof(ts_found_file));
new_result_buffer->files.reserve_jump = FILE_RESERVE_COUNT;
@@ -365,6 +366,7 @@ static void *_ts_list_files_thread(void *args)
while (!info->search_completed) {
if (info->completed_match_threads == info->max_ts_thread_count) {
info->search_completed = true; // No memory is written after this point.
+ info->timestamp = ts_platform_get_time(info->timestamp);
}
ts_thread_sleep(10);
}