Is there any similar API like Window's SetTimer()?

Hi!

In Windows, there is a API settimer() which takes callback function as input argument. When the timer expires, the callback will be called. But in Linux, I just found that OS would send an event to the process when the timer expires.

Is there any similar API like Window's SetTimer() in Linux?

BRs, // Charlie

Reply to
Charlie
Loading thread data ...

Using which method ?

You should be able to achieve the same using some combination of: sigaction signal setitimer or add_timer del_timer in the kernel.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Damion de Soto - Software Engineer  email:     damion@snapgear.com
 Click to see the full signature
Reply to
Damion de Soto

Take a look at the setitimer(2), signal(2) and signal(7) manpages

You're looking for signal SIGALARM sent by setitimer(2) to the callback specified by the signal(2) syscall.

--
Lew Pitcher

Master Codewright and JOAT-in-training
 Click to see the full signature
Reply to
Lew Pitcher

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.