本文整理匯總了VB.NET中System.TimeSpan.TotalMilliseconds屬性的典型用法代碼示例。如果您正苦於以下問題:VB.NET TimeSpan.TotalMilliseconds屬性的具體用法?VB.NET TimeSpan.TotalMilliseconds怎麽用?VB.NET TimeSpan.TotalMilliseconds使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類System.TimeSpan
的用法示例。
在下文中一共展示了TimeSpan.TotalMilliseconds屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: Example
Option Strict On
Module Example
Public Sub Main()
' Define an interval of 1 day, 15+ hours.
Dim interval As New TimeSpan(1, 15, 42, 45, 750)
Console.WriteLine("Value of TimeSpan: {0}", interval)
Console.WriteLine("There are {0:N5} milliseconds, as follows:", interval.TotalMilliseconds)
Dim nMilliseconds As Long = interval.Days * 24 * 60 * 60 * 1000 + _
interval.Hours *60 * 60 * 1000 + _
interval.Minutes * 60 * 1000 + _
interval.Seconds * 1000 + _
interval.Milliseconds
Console.WriteLine(" Milliseconds: {0,18:N0}", nMilliseconds)
Console.WriteLine(" Ticks: {0,18:N0}", nMilliseconds * 10000 - interval.Ticks)
End Sub
End Module
輸出:
Value of TimeSpan: 1.15:42:45.7500000 There are 142,965,750.00000 milliseconds, as follows: Milliseconds: 142,965,750 Ticks: 0