Linux: hrtimer 用法
来源:互联网 发布:网络写手排行榜 编辑:程序博客网 时间:2024/05/16 10:43
hrtimer = high res timer
内核为高精度定时器重新设计了一套软件架构,它可以为我们提供纳秒级的定时精度,以满足对精确时间有迫切需求的应用程序或内核驱动,例如多媒体应用,音频设备的驱动程序等等。以下的讨论用hrtimer(high resolution timer)表示高精度定时器。
#include <linux/hrtimer.h>
static struct hrtimer hrtimer;
//init
hrtimer_init(&hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
hrtimer.function = timer_hr_interrupt;
//
static enum hrtimer_restart timer_hr_interrupt(struct hrtimer *timer)
{
do_something();
return HRTIMER_NORESTART;
}
void start_timer(void)
{
hrtimer_start(&hrtimer, ktime_set(0, first_time* NSEC_PER_USEC), HRTIMER_MODE_REL);
}
static void do_something(void)
{
// do something
...
//start next timer
hrtimer_start(&hrtimer, ktime_set(0, next_time* NSEC_PER_USEC), HRTIMER_MODE_REL);
}
- Linux: hrtimer 用法
- Linux: hrtimer 用法
- Linux: hrtimer 用法
- Linux hrtimer的实现
- linux时间子系统 - hrtimer
- hrtimer
- Hrtimer
- hrtimer
- Linux hrtimer分析(一)
- Linux hrtimer分析(2)
- Linux hrtimer分析(一)
- Linux hrtimer分析(二)
- hrtimer(Linux 高精度定时器)
- Linux hrtimer分析(一)
- Linux hrtimer分析(2)
- Linux hrtimer分析(一)
- Linux hrtimer分析(2)
- Linux hrtimer分析(一)
- 去evernote啦
- JSP弹出窗口和模式对话框
- 温故知新--ASP.NET的Page指令
- openwrt上Motion视频监控软件的简单用法
- Linux中vim的应用技巧
- Linux: hrtimer 用法
- 反编译出错
- svn: Can't convert string from 'UTF-8' to native encoding 的解决办法
- umask掩码
- C中的volatile用法
- NoClassDefFoundError 当你发现即不是类名写错了 也不是配置出问题了 可以考虑下面方法
- convertView&setTag方法的一点理解
- Iptables基本语法
- 温故知新--ASP.NET的指令