Page 1 of 1

Less than 1 Millisecond Timing

Unread postPosted: 31 May 2015, 21:44
by Brindlefly
How can I run code at an interval of less than one millisecond? The Ti Lua API only allows me to use the timer event at an interval of greater than 10 milliseconds, or the timer.getMilliSecCounter() function which is still not a small enough interval.

Re: Less than 1 Millisecond Timing

Unread postPosted: 31 May 2015, 21:49
by pierrotdu18
You definitively can't.
Anyway, if you updated the screen quicker than 100Hz it wouldn't work as all the calculations would take more time than your period :p (and that's often the case with a period of 0.01 s only).

Re: Less than 1 Millisecond Timing

Unread postPosted: 31 May 2015, 22:00
by Brindlefly
So is less than one millisecond timing a ndless feature? There are some registers in the Gameboy Classic that increment faster than a millisecond, which makes me believe that the emulators can update faster than a millisecond or they just convert that calculation to one done every millisecond.

Re: Less than 1 Millisecond Timing

Unread postPosted: 31 May 2015, 22:04
by pierrotdu18
Oh, all gets different if you use Ndless. The C/C++ languages don't work as Lua: in Lua you have a timer that updates every x seconds, and in C/C++ you have no timer, just a loop; so, it is way faster and you even sometimes have to slow it down :p

Re: Less than 1 Millisecond Timing

Unread postPosted: 31 May 2015, 22:44
by Brindlefly
Darn, thanks for the help anyways.