From bdc2da9a94b9d765c424d8aaf01f786e71699ecf Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Thu, 17 Sep 2026 16:20:48 +0200 Subject: [PATCH] Report elapsed time when loading and saving state --- cmdline/state.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/cmdline/state.c b/cmdline/state.c index c70f638c..1cb1c9bc 100644 --- a/cmdline/state.c +++ b/cmdline/state.c @@ -4926,14 +4926,7 @@ static void state_write_content(struct snapraid_state* state, uint32_t* out_crc) /* LCOV_EXCL_STOP */ } - i = tommy_list_head(&state->contentlist); - while (i) { - struct snapraid_content* content = i->data; - - msg_progress("Saved %s in %" PRIu64 " seconds\n", content->content, (os_tick_ms() - start) / 1000); - - i = i->next; - } + msg_progress("Saved state in %" PRIu64 " seconds\n", (os_tick_ms() - start) / 1000); crc = context->crc; count_file = context->count_file; @@ -5014,6 +5007,9 @@ void state_read(struct snapraid_state* state) tommy_node* node; int ret; int c; + uint64_t start; + + start = os_tick_ms(); /* * Iterate over all the available content files and load the first one present. @@ -5154,6 +5150,8 @@ void state_read(struct snapraid_state* state) /* LCOV_EXCL_STOP */ } + msg_progress("Loaded state in %" PRIu64 " seconds\n", (os_tick_ms() - start) / 1000); + if (state->unsynced_blocks) msg_progress("WARNING! The latest sync was interrupted!\n");