使程序等待纳秒 [英] Make A Program wait for nano seconds

查看:85
本文介绍了使程序等待纳秒的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

是否可以让我的应用程序等待纳秒的时间?
?

请帮助.

Hello All,

Is it possible to make my application wait for a period of nano seconds?
?

Help please.

推荐答案

Windows不够准确. Abotu最好的办法就是测量延迟(以微秒为单位).由于Windows是共享系统,因此它可以并且将做其他事情,这些事情将延迟从使进程休眠"的函数调用返回的代码.没有专用的硬件和软件,就无法在Windows计算机上实现这种准确性和分辨率.
Windows is not that accurate. Abotu the best you can do is get a delay mesaured in microseconds. Since Windows is a shared system, it can and will be doing other things that will delay your codes return from such a function call that "sleeps" your process. Without specialized hardware and software, you cannot achieve that kind of accuracy and resolution on a Windows machine.


购买ChronoLogic USB-inSync并查阅其COM实用程序.

查看TimeSpan的文档:

最小的时间单位是滴答,等于100纳秒." ( TimeSpan.Ticks [
purchase a ChronoLogic USB-inSync and consult their COM utilities.

Look at the documentation for a TimeSpan:

"The smallest unit of time is the tick, which is equal to 100 nanoseconds." (TimeSpan.Ticks[^])

That''s the absolute best resolution of time that you are going to get without third-party hardware.


使用VB.Net计时器精确到纳秒级将非常困难. .
按照
[
Its going to be tough to be accurate to nano seconds using a VB.Net timer.
As per this[^] article, the precision of the timer is only in milliseconds.

You might want to consider some API''s to do this task.


这篇关于使程序等待纳秒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆