Refresh Text Field

I created a Timer that is supposed to refresh every 10 milliseconds. In the timer itself, I have it setting an iOSTextField with a string representation of a time in seconds.

This is the code in the timer - it is set as Mode: Multiple.

Dim seconds As Integer seconds=Microseconds/1000000/60/60 TimerText.text=seconds.ToText

The timer will set the time on first launch, but never refresh. Any suggestions?

Microseconds has a resolution of one million per second. You are dividing by 1000000 (one million), getting seconds, then dividing by 3600 (# of seconds in one hour). So your final number is actually Hours, not Seconds. Could that be the problem?

Edit: Also, you’ve defined Seconds as Integer, so you may be losing precision as well.

Try this:

  Dim seconds As double
  seconds=Microseconds/1000000.0   // convert from Microseconds to Seconds
  TimerText.text=seconds.ToText

As far as I can see, this in a 1000ms timer Action event does display very nicely seconds in a TextField :

Sub Action() dim d as date = Date.Now Textfield1.Text = d.Second.ToText End Sub