Crude Timers

Making Timer Interrupt as short as possible

  • 1
  • 2
  • Page 2 of 2
Merlin
Administrator
Avatar
Gender:
Age: 24
Posts: 1409
Registered: 03 / 2005
Subject:

Re: Crude Timers

 · 
Posted: 24.09.2018 - 10:54  ·  #9
Hello Thomas.

Thank you for investing the time on this particularly with the test.

I couldn't compile your code. Where is mySystemTime defined?

Sorry - I misread your comment 2) and thought that you meant something else. You are absolutely right.

It is easily fixed by changing SetCrudeTimer to

Code
procedure SetCrudeTimer( pTimer : TCrudeTimer; pDelay : word ); // delay in ms
begin
  fTimers[ pTimer ] := pDelay + word(fPulse);
end;


and thank you for this insight.
Avra
Schreiberling
Avatar
Gender:
Location: Belgrade, Serbia
Age: 53
Homepage: rs.linkedin.com/in…
Posts: 653
Registered: 07 / 2002
Subject:

Re: Crude Timers

 · 
Posted: 29.09.2018 - 10:44  ·  #10
Quote by Merlin

Here are two examples, both of which run in the sim. One using the SysTimer style approach and the other using callbacks.

Thank you. Very nice! :-)
  • 1
  • 2
  • Page 2 of 2
Selected quotes for multi-quoting:   0

Registered users in this topic

Currently no registered users in this section

The statistic shows who was online during the last 5 minutes. Updated every 90 seconds.
MySQL Queries: 15 · Cache Hits: 14   46   60 · Page-Gen-Time: 0.033099s · Memory Usage: 2 MB · GZIP: on · Viewport: SMXL-HiDPI