本文整理汇总了VB.NET中System.TimeSpan.FromMinutes方法的典型用法代码示例。如果您正苦于以下问题:VB.NET TimeSpan.FromMinutes方法的具体用法?VB.NET TimeSpan.FromMinutes怎么用?VB.NET TimeSpan.FromMinutes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.TimeSpan
的用法示例。
在下文中一共展示了TimeSpan.FromMinutes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: FromMinutesDemo
' Example of the TimeSpan.FromMinutes( Double ) method.
Module FromMinutesDemo
Sub GenTimeSpanFromMinutes( minutes As Double )
' Create a TimeSpan object and TimeSpan string from
' a number of minutes.
Dim interval As TimeSpan = _
TimeSpan.FromMinutes( minutes )
Dim timeInterval As String = interval.ToString( )
' Pad the end of the TimeSpan string with spaces if it
' does not contain milliseconds.
Dim pIndex As Integer = timeInterval.IndexOf( ":"c )
pIndex = timeInterval.IndexOf( "."c, pIndex )
If pIndex < 0 Then timeInterval &= " "
Console.WriteLine( "{0,21}{1,26}", minutes, timeInterval )
End Sub
Sub Main( )
Console.WriteLine( "This example of " & _
"TimeSpan.FromMinutes( Double )" & _
vbCrLf & "generates the following output." & vbCrLf )
Console.WriteLine( "{0,21}{1,18}", _
"FromMinutes", "TimeSpan" )
Console.WriteLine( "{0,21}{1,18}", _
"-----------", "--------" )
GenTimeSpanFromMinutes( 0.00001 )
GenTimeSpanFromMinutes( 0.00002 )
GenTimeSpanFromMinutes( 0.12345 )
GenTimeSpanFromMinutes( 1234.56789 )
GenTimeSpanFromMinutes( 12345678.98765 )
GenTimeSpanFromMinutes( 0.01666 )
GenTimeSpanFromMinutes( 1 )
GenTimeSpanFromMinutes( 60 )
GenTimeSpanFromMinutes( 1440 )
GenTimeSpanFromMinutes( 30020.33667 )
End Sub
End Module
' This example of TimeSpan.FromMinutes( Double )
输出:
FromMinutes TimeSpan ----------- -------- 1E-05 00:00:00.0010000 2E-05 00:00:00.0010000 0.12345 00:00:07.4070000 1234.56789 20:34:34.0730000 12345678.98765 8573.09:18:59.2590000 0.01666 00:00:01 1 00:01:00 60 01:00:00 1440 1.00:00:00 30020.33667 20.20:20:20.2000000