excel vba - Application.Ontime giving inaccurate results -
when run code below (test1), varying results, around 2.5 sec - 3 secs. understand being higher 3 secs if computer occupied else, less 3 makes no sense. i've tried xl2003 , xl2010, similar results. hope can explain me.
option explicit dim t double sub test1() debug.print application.ontime + timevalue("00:00:03"), "test2", , true ' t = timer end sub sub test2() debug.print ' debug.print timer - t end sub
now()
, timer
seem update values asynchronously. in quick tests variance ranging approx 0 1 second.
as have discovered should stick 1 source of time. aside, ontime
can scheduled in increments of 1 second.
Comments
Post a Comment