TimeSpan.WithUnits(String) Method

Top 

Description

Changes the reporting units of the TimeSpan. The value of the TimeSpan will be unaffected.

 

Timing Precision Mode

This page describes functionality in nanosecond timing precision mode.

 

Method Signature

TimeSpan.WithUnits(

String units)

 

 

Arguments

units


Description:

The reporting units to use.

Valid Values:

Value

Label

"day"

days

"hr"

hours

"min"

minutes

"s"

seconds

"ms"

milliseconds

"us"

microseconds

"ns"

nanoseconds

 

 

 

 

Return Value

Type:

timespan

Units:

day

 

 

When reported, returns the value of the TimeSpan expressed in the specified units.

 

Syntax

myTimeSpan1 = myTimeSpan2.WithUnits(myString1);

 

 

See also

TimeSpan Object

TimeSpans Guide

Parsing Dates and Times