From 1573db8f20387b8273bafc18d9ba6f7cbc67efaf Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Mon, 30 Oct 2023 08:59:42 +0100 Subject: [PATCH] Add timing information to the local console. --- bin/sync.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/sync.pl b/bin/sync.pl index e1840f2..10fcbf7 100644 --- a/bin/sync.pl +++ b/bin/sync.pl @@ -7,6 +7,7 @@ use JSON::XS; use LWP::UserAgent; use DBI; use POSIX; +use Time::HiRes; binmode STDOUT, ':utf8'; binmode STDERR, ':utf8'; use utf8; @@ -329,6 +330,8 @@ sub possibly_nag_user { } sub run { + my $start = [Time::HiRes::gettimeofday]; + @log = (); skv_log("Siste sync startet: " . POSIX::ctime(time)); @@ -590,6 +593,9 @@ sub run { push @yellow_updates, serialize_skv_log_to_sheet(); sheet_batch_update($ua, $token, \@yellow_updates); $dbh->commit; + + my $elapsed = Time::HiRes::tv_interval($start); + printf "Tok %.0f ms.\n", 1e3 * $elapsed; } if ($#ARGV >= 0 && $ARGV[0] eq '--daemon') { -- 2.39.5