开发者

Timer in VC++ for Non-GUI Applications

I want to test a code which is designed for running on a Microcontroller and it is platform independent.

Problem is I currently don't have any Embedded simulator (due to some damn reason!) and I want to test it... I am using Visual Studio 2008 (What a Pity!!).... Code is entirely in C but as VS 2008 doesn't support C, I have stored files as .cpp.... But No C++ concept is used!!

What all I require is a Timer which would generate Interrupt after every 1 millisecond!

And One more thing.... Can I configure something so that an Interrupt will be generated if I press certain key on K开发者_JAVA百科eyboard....

I don't want to make GUI. I searched for Timers and all were for MFC application.... If there isn't any option, I will make a rough MFC...

Regards!!


For high precision timers the your best bet is probably CreateTimerQueueTimer (not used personally).

Personally I used to use timeSetEvent but that was way back years and years ago.


You can try the Boost Asio Timers too. If you don't have it setup, please refer here: Getting Started on MS Windows.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜