• Advertisement

Archived

This topic is now archived and is closed to further replies.

Thread based timer?

This topic is 5832 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''ve been considering using a thread based timer in my next project, only problem is that I don''t know anything about threads... Anyone have any good links to throw at me? (I only found "POSIX Threads summary for experts" kind of things when searching (google)) /Mikael Jacobson

Share this post


Link to post
Share on other sites
Advertisement
Thanks, I didn''t even look at the win32 links though (remember children, always write portable code)

/Mikael Jacobson

Share this post


Link to post
Share on other sites
If you are writing only for Win32 I''d go with the performance counter stuff.

There''s an API that can call a user-supplied callback at a specified interval.

This is likely the most efficient for Win32.

If you are concerned with portability I''d suggest abstracting the timer callback mechanism and then provide a non-Win32 implementation version based on posix threads.

Share this post


Link to post
Share on other sites
I''m coding for UNIX in general and I''m trying to make it compile on windows machines as well...

/Mikael Jacobson

Share this post


Link to post
Share on other sites

  • Advertisement