Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 53db0226dc13429c3ad135acbd13265be67aa262
Ticket: 1567838fffffffffffffffffffffffffffffffff
Clock Creep using [after] on Windows
User & Date: ccdrbrg on 2006-09-29 15:44:18
Changes

  1. assignee changed to: "kennykb"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    System:
    Windows XP SP2 running tcl/tk 8.4.1 from cygwin.
    
    Posted on comp.lang.tcl by ccdrbrg (Thurs, Sep 28 2006
    9:07 am)
    
    I have written a simple ISO 8601 format clock display
    (source below).
    
    I have noticed the time value will creep ahead of the
    system time by as
    much as 30 seconds each day running.  I do not
    understand why.  I
    believe [clock seconds] queries the system time and is
    evaluated each
    time the after event is triggered.  The fact that the
    displayed time
    gets ahead of the system time is strange.
    
    Any help would be much appreciated.
    
    Chad
    
    System:
    Windows XP running tcl/tk 8.4.1 from cygwin.
    
    Source:
    
    variable date;
    
    proc iso8601date {  } {
      global date;
    
      set seconds [clock seconds];
      set date [clock format ${seconds} -gmt 1 -format
    {%Y-%m-%dT%TZ}];
    
      after 500 iso8601date;
    
    };
    
    iso8601date;
    
    package require Tk;
    
    wm protocol . WM_DELETE_WINDOW { exit };
    wm title . "ISO8601 Date";
    
    label .l -textvariable date -font {Arial 12 bold};
    pack .l  -padx 20;
    
    wm resizable . 0 0;
    
    bind .l <Double-Button-1> {
      clipboard clear;
      clipboard append [.l cget -text]; 
    };
    
    
    
    Reply from Kevin Kenny (Thurs, Sep 28 2006 9:18 pm)
    
    There's something gone wrong with the high-resolution
    timer and the
    way we synchronize that to the system clock.
    
    Please log a bug on this at SourceForge.  It may be a
    few weeks before
    I can give it a proper look, because I have travel
    coming up. 
    
    
  4. foundin changed to: "None"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "ccdrbrg"
  10. subsystem changed to: "03. Timer Events"
  11. title changed to: "Clock Creep using [after] on Windows"
  12. type changed to: "Bug"