ELCouz
ELCouz

Reputation: 572

Timers in Windows

I'm experiencing a problem with the SetTimer API.

Just for curiosity, what are my others options in Delphi?

Upvotes: 5

Views: 1179

Answers (3)

AudioGL
AudioGL

Reputation: 504

codeproject.com/Articles/1236/Timers-Tutorial#QueueTimers All are described here. I am a bit hesitant to use Multimedia Timers, but they still perform well under Windows 8. Either way, the Queue Timers, or Multimedia Timers, are going to give much better results.

Upvotes: 5

kludg
kludg

Reputation: 27493

I've written queue timer wrapper as a Delphi component The project is discontinued but you can take TksTimer code or install ksTools package.

Upvotes: 3

Stijn Sanders
Stijn Sanders

Reputation: 36850

When you need to do work according to a certain timing, you should also be asking if you need to do the work in threads. There's a big difference between handling timer events and off-loading work from the main thread into separate threads, both in how to set this up and in how it will perform (considering more and more hardware has multi-core processors).

The most basic way to do this is inherit from TThread, but it's not that straight-forward. (See 'Thread' in the Project New dialog, or the documentation) There are also a number of threading platforms for Delphi.

Upvotes: 3

Related Questions