Ticks, 1000000 in a second?

Discussion in 'Bug Reports' started by colin9876, Dec 8, 2007.

  1. colin9876

    colin9876 Active Member Licensed User

    I wrote a stopwatch program using Ticks.
    The help file says there is a million ticks in a second, but the counter/1000000 goes up by 10 a second???
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    I will check it.
    Anyway I recommend you to use the constants cTicksPerSecond / cTicksPerMinute / cTicksPerDay.
     
  3. agraham

    agraham Expert Licensed User

    Yes - I've come across this when benchmarking my Cray1 maths library. Although there ARE 10,000,000 (not 1,000,000) "ticks" in a second they are not real ticks. On my desktop "now" ticks about every 15.6ms (about 60hz - wonder why ;))and on my device only once per second. Each real tick adds enough virtual ticks to the tick counter to keep it in step with real time.

    You can see this with something like

    Then = now
    Do
    Next = now
    Loop Until Next <> Then
    msgbox(Next - Then)


    Because of this, especially on the device, things that need time comparisons should ensure that they have enough "real" ticks to give a meaningful result with the precision required.
     
  4. colin9876

    colin9876 Active Member Licensed User

    so Helpfile wrong

    ok if it is 10,000,000 ticks in a sec its just a typo in the helpfile not a bug in Basic4ppc
     
  5. agraham

    agraham Expert Licensed User

    Are your sure? My help file Time->Overview is correct.
     
  6. colin9876

    colin9876 Active Member Licensed User

    help on the device says 1,000,000 ticks per sec
     
  7. agraham

    agraham Expert Licensed User

    So it does - once I managed to find it! Sorry for doubting. If I look at the help I only ever use the desktop help as I can never find what I want on the device.
     
Loading...