LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 870|回复: 1

g_timer_elapsed的第二个参数是什么意思??请指点

[复制链接]
发表于 2007-4-26 16:06:51 | 显示全部楼层 |阅读模式
初次做linux的GUI项目,anjuta+gtk,请高手指教。

想用timer实现计时功能 ,例如发传真 ,从开始发送让g_timer_start

等到对方接收,对方接收后给我返回信息,这时让 g_timer_stop,

我想计算从发送开始到得到返回信息的时间,感觉用gdouble

g_timer_elapsed( GTimer *timergulong *microseconds );

这个调用 ,但是这里的第二个参数是什么意思阿???还有怎么从

timer里得出象hh:mm:ss的时间形式阿??请高手指点一下
发表于 2007-4-27 09:48:56 | 显示全部楼层
timer :         a GTimer.(开始你创建的那个计时器)
microseconds :         return location for the fractional part of seconds elapsed, in microseconds (that is, the total number of microseconds elapsed, modulo 1000000), or NULL
(耗费的时间,微秒)
Returns :         seconds elapsed as a floating point value, including any fractional part.
你写GTK的程序的话,建议你先装好GTK的document,另外Devhelp这个工具看GTK的文档蛮方便的。


另外,超时处理的话可以用 gtk_timeout_add()
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表