You're trying to compare two entirely different things.(您正在尝试比较两个完全不同的事物。)
DateTime.Now.Ticks
:(DateTime.Now.Ticks
:)
A single tick represents one hundred nanoseconds or one ten-millionth of a second.(一个滴答声代表一百纳秒或一百万分之一秒。) There are 10,000 ticks in a millisecond, or 10 million ticks in a second.(毫秒内有10,000个滴答声,在一秒内有1,000万个滴答声。)
The value of this property represents the number of 100-nanosecond intervals that have elapsed since 12:00:00 midnight, January 1, 0001 (0:00:00 UTC on January 1, 0001, in the Gregorian calendar), which represents DateTime.MinValue.(此属性的值表示自0001年1月1日午夜12:00:00(公历0001年1月1日0:00:00 UTC)以来经过的100纳秒间隔数,它表示DateTime .MinValue。) It does not include the number of ticks that are attributable to leap seconds.(它不包括归因于leap秒的刻度数。)
new Date().getTime()
:(new Date().getTime()
:)
The getTime() method returns the number of milliseconds* since the Unix Epoch [January 01, 1970](getTime()方法返回自Unix纪元[1970年1月1日]以来的毫秒数*。)
So you're comparing the number of milliseconds since Jan 1 0001 multiplied by 10,000 to the number of milliseconds since 1 Jan 1970. Of course they're going to be different.(因此,您正在将自0001年1月1日以来的毫秒数乘以10,000与自1970年1月1日以来的毫秒数进行比较。当然,它们将有所不同。) 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…