Code not working same on Desktop vs. Mobile

Discussion in 'Questions (Windows Mobile)' started by dletter, Jul 15, 2009.

  1. dletter

    dletter New Member Licensed User

    Here is the code I am using:

    ticks=Now-timerticks
    maintime = maintime + (ticks/1000000)
    intervaltime = intervaltime + (ticks/1000000)
    timerticks=Now
    displayTimers

    Sub displayTimers
    maintimehour=Int(maintime/36000)
    maintimemin=Int((maintime-(maintimehour)*36000)/600)
    maintimesec=Int((maintime-(maintimehour)*36000-(maintimemin)*600)/10)
    maintimetenth=maintime-(maintimehour)*36000-(maintimemin)*600-(maintimesec)*10
    TotalTime.Text = maintimehour & ":" & Format(maintimemin,"D2") & ":" & Format(maintimesec,"D2") & "." & Int(maintimetenth)

    inttimehour=Int(intervaltime/36000)
    inttimemin=Int((intervaltime-(inttimehour)*36000)/600)
    inttimesec=Int((intervaltime-(inttimehour)*36000-(inttimemin)*600)/10)
    inttimetenth=intervaltime-(inttimehour)*36000-(inttimemin)*600-(inttimesec)*10
    IntervalTime.Text = inttimehour & ":" & Format(inttimemin,"D2") & ":" & Format(inttimesec,"D2") & "." & Int(inttimetenth)

    End Sub

    When testing with the development tool, I am getting the tenth of seconds counting up on the timers. But when I build and use it on the phone, the tenths of seconds stays at 0 (the timer otherwise counts up at a second's pace though).

    Any ideas? Thanks.

    (On another note, I don't think this is the best way (in that I think there are some time inaccuracies introduced over a long period of time) to accomplish what I wanted here anyway, but it works for now. Any thoughts on the best way of increasing a timer, while allowing start/pause functionality, would be helpful).
     
  2. agraham

    agraham Expert Licensed User

    A desktop "ticks" at about 15mS intervals, devices only "tick" at 1S intervals.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice