Stopwatch.GetElapsedTime Method

Definition

Overloads

GetElapsedTime(Int64)

Gets the elapsed time since the startingTimestamp value retrieved using GetTimestamp().

GetElapsedTime(Int64, Int64)

Gets the elapsed time between two timestamps retrieved using GetTimestamp().

GetElapsedTime(Int64)

Source:
Stopwatch.cs
Source:
Stopwatch.cs
Source:
Stopwatch.cs

Gets the elapsed time since the startingTimestamp value retrieved using GetTimestamp().

C#
public static TimeSpan GetElapsedTime(long startingTimestamp);

Parameters

startingTimestamp
Int64

The timestamp marking the beginning of the time period.

Returns

A TimeSpan for the elapsed time between the starting timestamp and the time of this call.

Applies to

.NET 10 a ďalšie verzie
Produkt Verzie
.NET 7, 8, 9, 10

GetElapsedTime(Int64, Int64)

Source:
Stopwatch.cs
Source:
Stopwatch.cs
Source:
Stopwatch.cs

Gets the elapsed time between two timestamps retrieved using GetTimestamp().

C#
public static TimeSpan GetElapsedTime(long startingTimestamp, long endingTimestamp);

Parameters

startingTimestamp
Int64

The timestamp marking the beginning of the time period.

endingTimestamp
Int64

The timestamp marking the end of the time period.

Returns

A TimeSpan for the elapsed time between the starting and ending timestamps.

Applies to

.NET 10 a ďalšie verzie
Produkt Verzie
.NET 7, 8, 9, 10