阅读:2151回复:12
谁能在win2000内核实现3微秒定时,精确度是纳秒级???????
我想在实现每3微秒定时送一个数,精度要非常高,至少100 纳秒.不知道各位高手有何高见???
|
|
|
沙发#
发布于:2002-07-03 17:53
用软件的方法?不太容易!还是用硬件吧! The algorism is the hard way to simulate it. |
|
|
板凳#
发布于:2002-07-03 17:50
利用TSC计数器,它的精度随着你的cpu晶振频率变化可达到几个纳秒的。 Is it hareware? |
|
|
地板#
发布于:2002-07-03 17:15
用8254实现的大虾,好佩服你哦,联系一下吧。
|
|
地下室#
发布于:2002-07-03 16:15
谢谢!!我也觉得用软件实现!好像不太可能!!好多函数说是可以精确到100纳秒,定时时间可以到微秒,可我测试了好多都是10毫秒的.
因为我要实现每3微秒送一个数!! /////////////// Ares 发表于: 2002/7/3 - 14:06 用系统定时器啊,精度应该有保证的 你说的是硬件定时吧!???怎么用那??? 如果是软件定时,我是过了,不行的 |
|
|
5楼#
发布于:2002-07-03 15:56
利用TSC计数器,它的精度随着你的cpu晶振频率变化可达到几个纳秒的。
|
|
6楼#
发布于:2002-07-03 15:49
《WINDOWS核心编程中》讲的系统核心记时器,可以到很高的精度和准确度!
|
|
|
7楼#
发布于:2002-07-03 15:43
用软件的方法?不太容易!还是用硬件吧! 好想知道你是谁哟,居然叫advantech |
|
8楼#
发布于:2002-07-03 14:59
你这种定时精度是不可能的, 因为你对操作系统的基础不了解。
|
|
|
9楼#
发布于:2002-07-03 14:33
我做到了10微秒,精度大概在1微秒左右~~~~不过我用的是系统定时器8254-T/C0,它本身的定时精度为838纳秒,如果采用更高精度的定时器,应该可以实现更高的精度。
|
|
10楼#
发布于:2002-07-03 14:06
用系统定时器啊,精度应该有保证的
|
|
|
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 |
|
12楼#
发布于:2002-07-03 13:09
用软件的方法?不太容易!还是用硬件吧!
|
|