Moved storing of accumulated processing time to its own routine.
@@ -1129,6 +1129,22 @@ set_general_stats (void)
#endif
}
+/* Store accumulated processing time
+ * Note: As we store with time_t second resolution,
+ * if elapsed time == 0, we will bump it to 1.
+ */
+#ifdef TCB_BTREE
+static void
+set_accumulated_time (void)
+{
+ if (conf.store_accumulated_time) {
+ time_t elapsed = end_proc - start_proc;
+ elapsed = (!elapsed) ? !elapsed : elapsed;
+ ht_insert_genstats_accumulated_time (elapsed);
+ }
+}
+#endif
+
/* Execute the following calls right before we start the main
* processing/parsing loop */
static void
@@ -1488,15 +1504,7 @@ main (int argc, char **argv)
/* ignore outputting, process only */
if (conf.process_and_exit) {
#ifdef TCB_BTREE
- /* store accumulated processing time
- * Note: As we store with time_t second resolution,
- * if elapsed time == 0, we will bump it to 1.
- */
- if (conf.store_accumulated_time) {
- time_t elapsed = end_proc - start_proc;
- elapsed = (! elapsed) ? ! elapsed : elapsed;
- ht_insert_genstats_accumulated_time (elapsed);
- }
+ set_accumulated_time ();
#endif
}
/* stdout */
