我不明白时间精确度和分辨率的含义,有人能解释给我听吗?
注:这个问题与 " 守望站 " 有关。
我不明白时间精确度和分辨率的含义,有人能解释给我听吗?
注:这个问题与 " 守望站 " 有关。
准确性和精确性与目标对立, 您无法同时获得。 一个非常精确的时间源的例子就是 DateTime. Utcnow。 它为内核的时速率错误提供了自动纠正的绝对时间, 使用时间服务定期对时钟进行重新校正。 您可能听说过大多数 Windows PC 使用的 NTP 服务器的时间. windowows. com 。 非常精确地说, 您可以指望全年差差差不到一秒钟。 但是不准确的是, 值每秒只更新64次。 任何需要时间少于一秒的时间, 只要有某种精确度, 都毫无意义 。
Stopwatch 的时钟源非常不同。 它使用一个自由运行的计数器, 由芯片中某处可用的频率源驱动。 这曾经是一个在 < a href=" http:// en. wikipedia. org/ wiki/ Color_burst" rel= "nofollow" color 爆破频率 < / a > (3.579545 MHz) 上运行的专用晶体管, 但从大多数个人电脑中消除了这一特性。 Stopwatch 是非常精确的, 您可以从它的频率属性中知道。 您应该从一个兆赫和 cpu clock 频率之间获得某种东西, 允许您在微秒或更佳的时间间隔下运行。 但它不准确性, 但它受电子部分的容度不准确性。 特别是不信任任何来自一个乘数的频率, 也使错误倍增。 。 请注意 Heisenberg 原则, 开始和停止 停止 休望 将带来非 零 顶端的顶部位, 这将影响非常短的测量的精确性 。 。 。 。 另一个常见的精确性问题是操作系统切换出您的线以允许其他代码运行 。 您需要多个, 并使用中值 。
它们与任何测量都是一样的。详情请参见维基百科文章 -- --
There are different types of times in .net (3 or 4 of them, if i remember correctly), each working with his own algorithm. The precision of timer means how accurate it is in informing the using application on the ticking events. For example, if you use a timer and set it to trigger its ticking event every 1000 ms, the precision of the timer means how close to the specified 1000 ms it will actually tick.
for more information (at least in c#), i suggest u read the msdn page on timers:
来自MSDN STampwatch类 :(强调地雷)
“停止监视措施在基本计时器机制中计时计时计时器计时器时间。 如果安装的硬件和操作系统支持高分辨率性能计数器, 那么 停止监视类会用它来测量过的时间。 否则, 停止监视类会使用系统计时器来测量过的时间 。 < 坚固 > 使用频率和 IsHigh分辨率字段来确定 停止监视 < / 坚固 > 时间执行的精确度和分辨率 。 ”
What is the use of default keyword in C#? Is it introduced in C# 3.0 ?
I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...
I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...
I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...
I have two EF entities. One has a property called HouseNumber. The other has two properties, one called StartHouseNumber and one called EndHouseNumber. I want to create a many to many association ...
How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...
Since I cannot order my dictionary, what is the best way of going about taking key value pairs and also maintaing an index?
Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...