Table of Contents

Class MediaTime

Namespace
VAST.Common
Assembly
VAST.Common.dll

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

long

Methods

Convert(long, Rational, Rational)

Converts a timestamp from one timescale to another.

public static long Convert(long timestamp, Rational fromTimescale, Rational toTimescale)

Parameters

timestamp long

The timestamp value to convert.

fromTimescale Rational

The source timescale as a rational number.

toTimescale Rational

The 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

resolution long

The 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

s string

The date/time string in ISO 8601 format (e.g., "2024-01-15T14:30:00Z" or "2024-01-15T14:30:00+02:00").

Returns

DateTime?

A DateTime in UTC if parsing succeeds; otherwise, null.