UNIX alarm() with higher granularity
I am using the UNIX alarm
system call to deliver a signal to the current开发者_C百科ly running process on a schedule.
The man page describes the argument to this function as being in units of seconds. I would like to have precision in milliseconds.
Is there an alternative system call on UNIX (or Linux specifically) that will allow this?
Take a look at setitimer() or the more modern (and more flexible) timer_setitime() APIs.
I don't think there's a straight shell call possible, the perl module Time::HiRes allows this and there's the 3 argument perl select call, is it possible you could write a script to do it?
精彩评论