Why are multimedia timers obsolete?

Looking at the MSDN documentation for timeSetEvent (http://msdn.microsoft.com/en-us/library/windows/desktop/dd757634(v=vs.85).aspx), I can see that the function is marked as obsolete and the docs recommend using CreateTimerQueueTimer.

Does anyone know why timeSetEvent is obsolete? I have seen some reports online that the timer queue timers actually provide poorer accuracy, e.g.: http://omeg.pl/blog/2011/11/on-winapi-timers-and-their-resolution/

Thanks in advance for any insights.

Sasha

I would hazard a guess that they are marked obsolete because of power inefficiency. The longer you can hold off executing timer based code, the more power you can save. The queued timer allows for a bit of delay in the scheduling, providing the ability to coalesce requests

d

Bent from my phone


From: xxxxx@gmail.commailto:xxxxx
Sent: ?4/?26/?2014 10:25 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: [ntdev] Why are multimedia timers obsolete?

Looking at the MSDN documentation for timeSetEvent (http://msdn.microsoft.com/en-us/library/windows/desktop/dd757634(v=vs.85).aspx), I can see that the function is marked as obsolete and the docs recommend using CreateTimerQueueTimer.

Does anyone know why timeSetEvent is obsolete? I have seen some reports online that the timer queue timers actually provide poorer accuracy, e.g.: http://omeg.pl/blog/2011/11/on-winapi-timers-and-their-resolution/

Thanks in advance for any insights.

Sasha


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>

@Doron:

I would hazard a guess that they are marked obsolete because of power
inefficiency. The longer you can hold off executing timer based code, the more
power you can save. The queued timer allows for a bit of delay in the
scheduling, providing the ability to coalesce requests

I have very strong suspicion they both are implemented with similar underlying mechanism. Multimedia timers, by definition, try to provide as little latency as possible. Their worker thread might be running with elevated priority. But if you need low latency, that’s what you have to do.

Timer queues were designed for high volume - for example, for supporting server requests timeouts. They try to be a mother of all timers. But for a GUI application you might as well simply use SetTimer.

>I have very strong suspicion they both are implemented with similar

underlying mechanism. Multimedia >timers, by definition, try to provide as
little latency as possible. Their worker thread might be running with
>elevated priority. But if you need low latency, that’s what you have to
do.

I think the “low latency” promise was invalidated (more than ever) with the
introduction of the “dynamic clock tick” feature in Windows 8 which they
said was meant as a power saving feature.

In any case timers in Windows exist only in software based form. Although
the HPET comes with 256 programmable accurate timers, they are not available
to be programmed. If you need a precise timer in Windows you had better
bring your own hardware which fires its own interrupts.

//Daniel

Or one you can read. Correct.

In fact, we’re presently working with a client that does exactly that. With a *very* high level of precision, in fact. Like OCXO + GPS discipline accurate.

Really interesting project.

Peter
OSR
@OSRDrivers

xxxxx@gmail.com wrote:

Looking at the MSDN documentation for timeSetEvent (http://msdn.microsoft.com/en-us/library/windows/desktop/dd757634(v=vs.85).aspx), I can see that the function is marked as obsolete and the docs recommend using CreateTimerQueueTimer.

Does anyone know why timeSetEvent is obsolete? I have seen some reports online that the timer queue timers actually provide poorer accuracy, e.g.: http://omeg.pl/blog/2011/11/on-winapi-timers-and-their-resolution/

The entire multimedia subsystem (mmsystem.h and WinMM.lib) has been
deprecated. That includes the installable driver interface,
waveIn/waveOut, VFW, and all of their friends.

It all continues to work (very well), and in my view it provides a
simpler solution than many of its replacements, but if something breaks,
Microsoft won’t fix it.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.