在C#中搜索最小的时间值 [英] Searching for smallest time value in C#

查看:265
本文介绍了在C#中搜索最小的时间值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过使用C#内置的API

By using C# built-in API

System.DateTime.Now.Millisecond

我可以生成毫秒。

但是当我想到

  • Microsecond
  • Nanosecond
  • Picosecond
  • Femtosecond
  • Attosecond

我找不到来自

System.DateTime

有人可以给我建议吗?

推荐答案

鉴于日期/时间的分辨率只有十毫秒,可能认为没有必要尝试并具有包含比一毫秒更小的分辨率的任何内容的属性。

Given that the resolution of the date/time is only ten milliseconds, it's probably considered unnecessary to try and have properties containing anything with a smaller resolution than one millisecond.

它们的值只是毫秒值,最后加上一些零。

The values for them would simply be the milliseconds value with some zeros tacked on the end.

计算机已经走了很长的路自上世纪中叶以来,由于在宇宙速度限制下运行的光子(a)只能在一个阿托品中穿过几个氢原子,这是一个尝试想象这样一个分辨率有用的方法将是。

Computers have come a long way since mid last century but, given that a photon running at the speed limit of the universe(a) will only cross a few hydrogen atoms in one attosecond, it's a stretch trying to imagine how useful such a resolution would be.

以5GHz运行的(经典)CPU只能在该时间段内达到指令的五十分之一。

A (classic) CPU running at 5GHz would only get through five billionths of an instruction in that timeframe.

(a)我最喜欢的报价之一:光速。这不仅仅是一个好主意,而是法律。

(a) One of my favorite quotes: The speed of light. It's not just a good idea, it's the law.

这篇关于在C#中搜索最小的时间值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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