I have worked for some time now on Linux and done some C programs, and now I need to build an app for windows but is not being easy to find a replacement for the alarm function (found on signal.h)...
The thing is, in Linux, when you set the alarm flag as SIGALRM (if not mistaken), what the OS is going to do is to execute some function when the alarm goes off.
Example:
signal(SIGALRM, myfunc);
alarm (2);
What is going to happen on this example is the OS is going to call the function myfunc every 2 seconds (in windows is going to be miliseconds probably, but don't mind that detail right now).
I've searched for some time how to do the same on windows (only using windows.h atm) but I can't find a replacement for that (searched thousands of times on msdn), and, on windows there is no SIGALRM flag on the signal.h.....
What can I use in C to do the same behaviour as the alarm with the SIGALRM flag?(In other words, a function that allows to execute another function using an alarm or similar).
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…