Method | Description | |
---|---|---|
Convert ( System.TimeSpan value, TimeUnit unit ) : double |
Expresses a TimeSpan duration in the desired TimeUnit.
|
|
DiscoverUnit ( System.TimeSpan timeSpan ) : TimeUnit |
Discover the most appropriate TimeUnit to express the given duration.
|
|
GetFromNanoSeconds ( double duration, TimeUnit timeUnit ) : double |
Converts a duration in nanoseconds to the desired TimeUnit.
|
|
GetInNanoSeconds ( double value, TimeUnit unit ) : double |
Converts a duration in nanoseconds.
|
|
ToTimeSpan ( double value, TimeUnit timeUnit ) : System.TimeSpan |
Creates a TimeSpan representing the duration expressed in TimeUnit.
|
Method | Description | |
---|---|---|
GetConversionFactor ( TimeUnit unit ) : long |
public static Convert ( System.TimeSpan value, TimeUnit unit ) : double | ||
value | System.TimeSpan | Duration to convert. |
unit | TimeUnit | |
return | double |
public static DiscoverUnit ( System.TimeSpan timeSpan ) : TimeUnit | ||
timeSpan | System.TimeSpan | /// Duration to analyze. /// |
return | TimeUnit |
public static GetFromNanoSeconds ( double duration, TimeUnit timeUnit ) : double | ||
duration | double | /// The duration in nanoseconds. /// |
timeUnit | TimeUnit | /// The time unit desired. /// |
return | double |
public static GetInNanoSeconds ( double value, TimeUnit unit ) : double | ||
value | double | Number of time units. |
unit | TimeUnit | Time unit in which duration is expressed. |
return | double |
public static ToTimeSpan ( double value, TimeUnit timeUnit ) : System.TimeSpan | ||
value | double | /// Duration duration. /// |
timeUnit | TimeUnit | /// Duration unit. /// |
return | System.TimeSpan |