# MediaTime

> Time representation for use with media containers.

## Definition

* **Type:** Struct
* **Namespace:** [UnityEditor.Media](/engine/6000.3/script-reference/unityeditor/media.md)
* **Assembly:** UnityEditor

```csharp
public struct MediaTime
```

## Remarks

A [MediaTime](/engine/6000.3/script-reference/unityeditor/media/mediatime.md) can be thought of as "sample #`count` at `rate` Hz".

This representation is precise, even for large values, because the sample count and rate are stored separately and do not make use of floating point storage.

## Static Fields

| Value                                                                             | Description         |
| --------------------------------------------------------------------------------- | ------------------- |
| [Invalid](/engine/6000.3/script-reference/unityeditor/media/mediatime/invalid.md) | Invalid time value. |

## Constructors

| Constructor                                                                                                                                            | Description                                                                     |
| ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------- |
| [MediaTime(System.Int64)](/engine/6000.3/script-reference/unityeditor/media/mediatime/ctor.md#mediatime\(long\))                                       | Creates a time value with an integer number of seconds, using 1Hz for the rate. |
| [MediaTime(System.Int64,System.UInt32,System.UInt32)](/engine/6000.3/script-reference/unityeditor/media/mediatime/ctor.md#mediatime\(long-uint-uint\)) | Creates a time value for a specified sample count and rate.                     |

## Properties

| Property                                                                      | Description                                          |
| ----------------------------------------------------------------------------- | ---------------------------------------------------- |
| [count](/engine/6000.3/script-reference/unityeditor/media/mediatime/count.md) | The sample count for the time value.                 |
| [rate](/engine/6000.3/script-reference/unityeditor/media/mediatime/rate.md)   | The rate used for converting the count into seconds. |

## Operators

| Operator                                                                             | Description                                                             |
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------- |
| [double](/engine/6000.3/script-reference/unityeditor/media/mediatime/op-explicit.md) | Returns the time value expressed as a floating point number of seconds. |
