Re: Timer in a conmsole application
Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance
"Lubomir" <Lubomir@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:BF19BC42-AAFC-4C8F-862F-8CB9B58A4662@xxxxxxxxxxxxxxxx
> I have implemented a timer in a console application. In SetTimer function
> I
> specified a callback function, which should execute every X seconds.
>
> The problem is this this function is never called. I guess it has
> something
> to do with windows messages dispatching.
>
> Any idea what should I do?
I see that James has already explained the immediate cause of your problem.
You also have the option to use timeSetEvent() with the TIME_PERIODIC flag.
This will dispatch the timer callback in a secondary thread.
Regards,
Will
.
Relevant Pages
- Re: signals/threads
... >In most cases the number of signals doesn't matter anyway, ... I was trying to implement a timer functionality -not sure its the right ... Timer request also contains the callback function to be executed. ... amount of time to execute ... (comp.os.linux.development.apps) - Re: signals/threads
... >I was trying to implement a timer functionality -not sure its the right ... Timer request also contains the callback function to be executed. ... >amount of time to execute ... What I have done is set flags, other threads monitor the relevant flags ... (comp.os.linux.development.apps) - Re: Timer in a conmsole application
... In SetTimer function ... > specified a callback function, which should execute every X seconds. ... > to do with windows messages dispatching. ... GetMessage/DispatchMessage loop), and implement the timer ... (microsoft.public.win32.programmer.ui) - Re: timer function and too many input arguments
... error when the timer is started in my code. ... So sampleee is your TimerFcn. ... handle to the timer object and an event structure. ... In addition to these two required input arguments, your callback function ... (comp.soft-sys.matlab) - [PATCH 3/7] tracing: Convert some timer events to DEFINE_EVENT
... text data bss dec hex filename ... timer_cancel - called when the timer is canceled ... * determine the runtime of the callback function. ... TP_PROTO(struct hrtimer *hrtimer), ... (Linux-Kernel) |
|