From: phk Date: Wed, 19 Jul 2006 19:49:22 +0000 (+0000) Subject: Update only once per second. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b014f4ee089d33f78d9af3a8f3883435055cfd7a;p=varnish Update only once per second. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@506 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishtop/varnishtop.c b/varnish-cache/bin/varnishtop/varnishtop.c index ac1d0f70..2de0bc5f 100644 --- a/varnish-cache/bin/varnishtop/varnishtop.c +++ b/varnish-cache/bin/varnishtop/varnishtop.c @@ -45,6 +45,13 @@ upd(void) int l; double t = 0; unsigned u = 0; + static time_t last; + time_t now; + + now = time(NULL); + if (now == last) + return; + last = now; erase(); l = 0;