! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
minutes update may have noticeable latency in datetime plugin


Description Steve 2008-05-29 13:01:00 CEST
Sometimes the minutes update may have a latency of up to 9 seconds.

Reproduce as follows.
Start gkrellm and configure it display the time with one second resolution.
Bring up the datetime plugin properties panel and wait for gkrellm to show the system time is 8 or 9 seconds past the minute. (The datetime plugin's time format must show minutes, but not seconds.)
Click close immediately.
Wait for gkrellm to show the next minute (i.e. the minute tick) and begin counting seconds.
The datetime plugin displays the current minutes after a delay of 8 or 9 seconds.

This procedure is more reliable and (the latency more annoying) if the computer is accurately synced with atomic time (e.g. by running ntpd) and if a radio-controlled clock (also synced with atomic time) is available that "ticks" each second. (Some analog radio-controlled clocks make an audible sound each second.) WWV could also be used for an audible tick.

Version is trunk.

See also bug 4117, comment 4.
Comment 1 Steve 2008-05-29 13:20:59 CEST
Created attachment 1649 
patch to synchronize plugin updates with system clock

This patch is on top of the patch attached in bug 4117, comment 2.
Comment 2 Diego Ongaro 2008-05-29 22:36:45 CEST
Thanks for the patch. I simplified the math a bit and committed as r4862. I think it should be mathematically equivalent, and seems to work for me. Please reopen this bug if there are any problems.
Comment 3 Steve 2008-05-30 22:19:35 CEST
(In reply to comment #2)
> Thanks for the patch. I simplified the math a bit and committed as r4862. I
> think it should be mathematically equivalent, and seems to work for me.

Thanks! Your simplification is much nicer. I would never have thought to cast to a gint64 to avoid overflow.

A stack of four instances of the plugin with each configured to update once a second appears to update simultaneously and in sync with my radio-controlled clock (with the computer running ntpd). Likewise when all four are configured to update once a minute.

Running strace on the panel shows a latency of about 3 ms on the update of the first instance and a latency of about 5 ms to 8 ms for the fourth instance.

Powertop shows 1.0 wakeups per second when all four updates are once a second and less than 0.1 wakeups per second when all updates are once a minute.

Comment 4 Steve 2008-05-30 22:35:15 CEST
Created attachment 1652 
strace snippet showing update latencies in stack of four instances

This strace snippet was captured with the panel running four instances of the datetime plugin. All four instances were configured to display the time in seconds. The annotation names the functions called by datetime_update() that ultimately make calls to gettimeofday().

$ ps -e | grep xfce4-panel
 2383 ?        00:04:01 xfce4-panel
$ strace -p 2383 -ttt 2>strace1.txt
Comment 5 Diego Ongaro 2008-05-31 00:47:40 CEST
Heh, those are some cool ways of verifying the change, thanks.

Bug #4119

Reported by:
Reported on: 2008-05-29
Last modified on: 2010-11-09


Diego Ongaro
CC List:
1 user




Additional information