zhangchunxia
驱动牛犊
驱动牛犊
  • 注册日期2002-03-27
  • 最后登录2004-05-09
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:2151回复:12

谁能在win2000内核实现3微秒定时,精确度是纳秒级???????

楼主#
更多 发布于:2002-07-03 10:13
我想在实现每3微秒定时送一个数,精度要非常高,至少100 纳秒.不知道各位高手有何高见???
nice
Nouk
驱动中牛
驱动中牛
  • 注册日期2001-08-22
  • 最后登录2006-10-22
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2002-07-03 17:53
用软件的方法?不太容易!还是用硬件吧!

The algorism is the hard way to simulate it.
Taiwan's Driver Developer
Nouk
驱动中牛
驱动中牛
  • 注册日期2001-08-22
  • 最后登录2006-10-22
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2002-07-03 17:50
利用TSC计数器,它的精度随着你的cpu晶振频率变化可达到几个纳秒的。

Is it hareware?
Taiwan's Driver Developer
appleisred
驱动牛犊
驱动牛犊
  • 注册日期2002-07-03
  • 最后登录2009-11-01
  • 粉丝0
  • 关注0
  • 积分6分
  • 威望23点
  • 贡献值0点
  • 好评度11点
  • 原创分0分
  • 专家分0分
地板#
发布于:2002-07-03 17:15
用8254实现的大虾,好佩服你哦,联系一下吧。
zhangchunxia
驱动牛犊
驱动牛犊
  • 注册日期2002-03-27
  • 最后登录2004-05-09
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2002-07-03 16:15
谢谢!!我也觉得用软件实现!好像不太可能!!好多函数说是可以精确到100纳秒,定时时间可以到微秒,可我测试了好多都是10毫秒的.
因为我要实现每3微秒送一个数!!
///////////////
Ares

 发表于: 2002/7/3 - 14:06
用系统定时器啊,精度应该有保证的
你说的是硬件定时吧!???怎么用那???
如果是软件定时,我是过了,不行的

nice
ysy
ysy
驱动中牛
驱动中牛
  • 注册日期2002-02-18
  • 最后登录2008-08-25
  • 粉丝0
  • 关注0
  • 积分201分
  • 威望29点
  • 贡献值0点
  • 好评度19点
  • 原创分0分
  • 专家分0分
5楼#
发布于:2002-07-03 15:56
利用TSC计数器,它的精度随着你的cpu晶振频率变化可达到几个纳秒的。
BitterGourd
驱动牛犊
驱动牛犊
  • 注册日期2002-07-02
  • 最后登录2002-07-23
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
6楼#
发布于:2002-07-03 15:49
《WINDOWS核心编程中》讲的系统核心记时器,可以到很高的精度和准确度!
本人乃编程爱好者而已。苦瓜
arthurtu
驱动巨牛
驱动巨牛
  • 注册日期2001-11-08
  • 最后登录2020-12-19
  • 粉丝0
  • 关注0
  • 积分26分
  • 威望161点
  • 贡献值0点
  • 好评度35点
  • 原创分0分
  • 专家分0分
  • 社区居民
7楼#
发布于:2002-07-03 15:43
用软件的方法?不太容易!还是用硬件吧!

好想知道你是谁哟,居然叫advantech
tongqing
驱动牛犊
驱动牛犊
  • 注册日期2002-04-22
  • 最后登录2002-07-03
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
8楼#
发布于:2002-07-03 14:59
你这种定时精度是不可能的, 因为你对操作系统的基础不了解。
唐青松
xdjm
驱动中牛
驱动中牛
  • 注册日期2001-04-02
  • 最后登录2024-01-25
  • 粉丝0
  • 关注0
  • 积分34分
  • 威望25点
  • 贡献值0点
  • 好评度3点
  • 原创分0分
  • 专家分0分
  • 社区居民
9楼#
发布于:2002-07-03 14:33
我做到了10微秒,精度大概在1微秒左右~~~~不过我用的是系统定时器8254-T/C0,它本身的定时精度为838纳秒,如果采用更高精度的定时器,应该可以实现更高的精度。
Ares
驱动小牛
驱动小牛
  • 注册日期2001-03-28
  • 最后登录2020-04-09
  • 粉丝0
  • 关注0
  • 积分20分
  • 威望114点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
  • 社区居民
10楼#
发布于:2002-07-03 14:06
用系统定时器啊,精度应该有保证的
易水
bag
bag
驱动牛犊
驱动牛犊
  • 注册日期2002-03-19
  • 最后登录2007-10-22
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
11楼#
发布于:2002-07-03 14:03
KeDelayExecutionThread
NTSTATUS
   KeDelayExecutionThread(
       IN KPROCESSOR_MODE WaitMode,
       IN BOOLEAN Alertable,
       IN PLARGE_INTEGER Interval
       );

KeDelayExecutionThread puts the current thread into an alertable or nonalertable wait state for a given interval.

Parameters
WaitMode
Specifies the processor mode in which the caller is waiting, which can be either KernelMode or UserMode. Lower-level drivers should specify KernelMode.
Alertable
Specifies TRUE if the wait is alertable. Lower-level drivers should specify FALSE.
Interval
Specifies the absolute or relative time, in units of 100 nanoseconds, for which the wait is to occur. A negative value indicates relative time. Absolute expiration times track any changes in system time; relative expiration times are not affected by system time changes.
Return Value
KeDelayExecutionThread returns a value that how the delay was completed, which can be one of the following:

STATUS_SUCCESS
The delay completed because the specified interval elapsed.
STATUS_ALERTED
The delay completed because the thread was alerted.
STATUS_USER_APC
A user-mode APC was delivered before the given Interval expired.
Comments
The expiration time is computed and the current thread is put in a wait state. When the specified interval has passed, the thread exits the wait state and is put in the ready state, becoming eligible for execution.

The Alertable parameter specifies whether the thread can be alerted in the wait state. If the value of this parameter is TRUE and the thread is alerted for a mode that is equal to or more privileged than the given WaitMode, the thread\'s wait will be satisfied with a completion status of STATUS_ALERTED.

If the WaitMode parameter is UserMode and the Alertable parameter is TRUE, the thread can also be awakened to deliver a user-mode APC. Kernel-mode APCs always cause the subject thread to be awakened if the wait IRQL is PASSIVE_LEVEL and no kernel APC is in progress.

The expiration time of the delay is expressed as either an absolute time at which the delay is to expire, or a time relative to the current system time. If the Interval parameter is a negative value, the expiration time is relative.

Callers of KeDelayExecutionThread must be running at IRQL PASSIVE_LEVEL.

See Also
KeQuerySystemTime

Built on Friday, May 21, 1999
advantech
驱动牛犊
驱动牛犊
  • 注册日期2002-07-03
  • 最后登录2005-12-20
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
12楼#
发布于:2002-07-03 13:09
用软件的方法?不太容易!还是用硬件吧!
游客

返回顶部