由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - How to set a timer in C?
相关主题
请问如何给sigalrm_handler传递参数Question about a TICPP example
About timeout in Socket Programming.C# 的问题, event 这个关键字有什么用?
How does YAHOO calculate RSI? (转载)Linux 里让一个程序运行30秒,然后就KILL,然后一段时间后再开始运行
为什么用try catch不住exception?c++ 怎么让一段程序每10秒钟run一次?
About volatile in C[合集] 请教一个关于 kill process 的问题.
one question about exception为什么有点函数声明的参数类型但是没有变量名呢?
又被铐倒了,关于constructorGCJ2009
program trap(s)中文翻译成什么最好?请教C++程序中手动Ctrl+C后,如何才可以调用一下自己写的退出函数
相关话题的讨论汇总
话题: timer话题: set话题: my话题: use话题: sigalrm
进入Programming版参与讨论
1 (共1页)
a*****r
发帖数: 443
1
I am programming in C where need a timer to make sure the program will use t
he function periodically.
My present idea is only to use a loop to get time() and calculate, but it lo
oks like very stupid.
My question is how to set the timer in a smart way.
Thanks for your help very much.
c*r
发帖数: 278
2
interval timer and SIGALRM.
use alarm() or setitimer().
set proper handler for SIGALRM

【在 a*****r 的大作中提到】
: I am programming in C where need a timer to make sure the program will use t
: he function periodically.
: My present idea is only to use a loop to get time() and calculate, but it lo
: oks like very stupid.
: My question is how to set the timer in a smart way.
: Thanks for your help very much.

1 (共1页)
进入Programming版参与讨论
相关主题
请教C++程序中手动Ctrl+C后,如何才可以调用一下自己写的退出函数About volatile in C
关于signal handlerone question about exception
A C++ exception question又被铐倒了,关于constructor
gsl的这帮人太不负责了program trap(s)中文翻译成什么最好?
请问如何给sigalrm_handler传递参数Question about a TICPP example
About timeout in Socket Programming.C# 的问题, event 这个关键字有什么用?
How does YAHOO calculate RSI? (转载)Linux 里让一个程序运行30秒,然后就KILL,然后一段时间后再开始运行
为什么用try catch不住exception?c++ 怎么让一段程序每10秒钟run一次?
相关话题的讨论汇总
话题: timer话题: set话题: my话题: use话题: sigalrm