Sub Activity_Create(FirstTime As Boolean)
'...
Ticks=DateTime.Now 'Ticks takes the value of time when the program starts
dTime=Ticks 'dTime takes a copy o Ticks
...
Ens Sub
Sub DoSometing
dt=DateTime.Now 'checks time again
If dt> dTime Then 'if time changed
hh=DateTime.Gethour(dt-Ticks)
mm=DateTime.GetMinute(dt-Ticks)
ss=DateTime.Getsecond(dt-Ticks)
dTime=dt 'updates the check time
End if
End Sub