Re: [dev] golang: time.Tick() and ntp

From: Brandon Mulcahy <brandon_AT_jangler.info>
Date: Wed, 8 Oct 2014 07:27:48 -0400

On Wed, Oct 08, 2014 at 12:23:59PM +0200, Markus Teich wrote:
> The second problem is when using ntp to synchronize the clock. In this
> case the channel provided by time.Tick() stops to send on that channel and
> therefore the whole loop stops and the status bar is not updated anymore.
>
> Can you help me with an idiomatic solution for these two problems?

Is there a reason this wouldn't work?

for {
        // ...
        time.Now().Format("Mon 02 Ý 15:04:05"),
        // ...
        time.Sleep(time.Second)
}
Received on Wed Oct 08 2014 - 13:27:48 CEST

This archive was generated by hypermail 2.3.0 : Wed Oct 08 2014 - 13:36:07 CEST