Class MediaTime
Provides high-resolution timing utilities for media operations.
public static class MediaTime
- Inheritance
-
MediaTime
- Inherited Members
Fields
DefaultResolution
The default time resolution in ticks per second (10,000,000 = 100 nanosecond intervals).
public static readonly long DefaultResolution
Field Value
Methods
Convert(long, Rational, Rational)
Converts a timestamp from one timescale to another.
public static long Convert(long timestamp, Rational fromTimescale, Rational toTimescale)
Parameters
timestamplongThe timestamp value to convert.
fromTimescaleRationalThe source timescale as a rational number.
toTimescaleRationalThe target timescale as a rational number.
Returns
- long
The converted timestamp in the target timescale.
Get()
Gets the current elapsed time using the default resolution.
public static long Get()
Returns
- long
The elapsed time in ticks at the default resolution (100 nanosecond intervals).
Get(long)
Gets the current elapsed time using the specified resolution.
public static long Get(long resolution)
Parameters
resolutionlongThe desired time resolution in ticks per second.
Returns
- long
The elapsed time in ticks at the specified resolution.
ParseAbsoluteTime(string)
Parses an ISO 8601 formatted date/time string into a DateTime value.
public static DateTime? ParseAbsoluteTime(string s)
Parameters
sstringThe date/time string in ISO 8601 format (e.g., "2024-01-15T14:30:00Z" or "2024-01-15T14:30:00+02:00").