METHOD

TimeProvider.GetTimestamp

Gets a timestamp for elapsed-time measurement from the selected provider. Timestamp units are provider-specific; do not treat the value as UTC ticks or a portable persisted deadline.

Formal Syntax & Structure

csharp syntaxcsharp
clock.GetTimestamp()

Working Example

Example Snippetcsharp
using System;using System.Collections.Generic;using System.Threading;using System.Threading.Tasks;using System.Threading.Channels;long start=TimeProvider.System.GetTimestamp(); Console.WriteLine(start); // Varies; not a graded output.
C# & .NET Reference