# PlayerLoopTimer Class | UniTask

Show / Hide Table of Contents

# PlayerLoopTimer Class

###### Namespace: Cysharp.Threading.Tasks

###### Assembly: cs.temp.dll.dll

    public abstract class PlayerLoopTimer : IDisposable, IPlayerLoopItem

##### Inheritance

System.Object → PlayerLoopTimer

##### Implements

System.IDisposable
IPlayerLoopItem

### Members

#### Constructors

Name | Description
--- | ---
PlayerLoopTimer(Boolean, PlayerLoopTiming, CancellationToken, Action<Object>, Object) |

#### Methods

Name | Description
--- | ---
Create(TimeSpan, Boolean, DelayType, PlayerLoopTiming, CancellationToken, Action<Object>, Object) |
Dispose() |
MoveNextCore() |
ResetCore(Nullable<TimeSpan>) |
Restart() | Restart(Reset and Start) timer.
Restart(TimeSpan) | Restart(Reset and Start) and change interval.
StartNew(TimeSpan, Boolean, DelayType, PlayerLoopTiming, CancellationToken, Action<Object>, Object) |
Stop() | Stop timer.

#### Explicit Interface Implementations

Name | Description
--- | ---
IPlayerLoopItem.MoveNext() |

### Constructors

#### PlayerLoopTimer(Boolean, PlayerLoopTiming, CancellationToken, Action<Object>, Object)

    protected PlayerLoopTimer(bool periodic, PlayerLoopTiming playerLoopTiming, CancellationToken cancellationToken, Action<object> timerCallback, object state)

##### Parameters

`periodic` System.Boolean
`playerLoopTiming` PlayerLoopTiming
`cancellationToken` System.Threading.CancellationToken
`timerCallback` System.Action<System.Object>
`state` System.Object

### Methods

#### Create(TimeSpan, Boolean, DelayType, PlayerLoopTiming, CancellationToken, Action<Object>, Object)

    public static PlayerLoopTimer Create(TimeSpan interval, bool periodic, DelayType delayType, PlayerLoopTiming playerLoopTiming, CancellationToken cancellationToken, Action<object> timerCallback, object state)

##### Parameters

`interval` System.TimeSpan
`periodic` System.Boolean
`delayType` DelayType
`playerLoopTiming` PlayerLoopTiming
`cancellationToken` System.Threading.CancellationToken
`timerCallback` System.Action<System.Object>
`state` System.Object

##### Returns

PlayerLoopTimer

#### Dispose()

    public void Dispose()

#### MoveNextCore()

    protected abstract bool MoveNextCore()

##### Returns

System.Boolean

#### ResetCore(Nullable<TimeSpan>)

    protected abstract void ResetCore(TimeSpan? newInterval)

##### Parameters

`newInterval` System.Nullable<System.TimeSpan>

#### Restart()

Restart(Reset and Start) timer.

    public void Restart()

#### Restart(TimeSpan)

Restart(Reset and Start) and change interval.

    public void Restart(TimeSpan interval)

##### Parameters

`interval` System.TimeSpan

#### StartNew(TimeSpan, Boolean, DelayType, PlayerLoopTiming, CancellationToken, Action<Object>, Object)

    public static PlayerLoopTimer StartNew(TimeSpan interval, bool periodic, DelayType delayType, PlayerLoopTiming playerLoopTiming, CancellationToken cancellationToken, Action<object> timerCallback, object state)

##### Parameters

`interval` System.TimeSpan
`periodic` System.Boolean
`delayType` DelayType
`playerLoopTiming` PlayerLoopTiming
`cancellationToken` System.Threading.CancellationToken
`timerCallback` System.Action<System.Object>
`state` System.Object

##### Returns

PlayerLoopTimer

#### Stop()

Stop timer.

    public void Stop()

### Explicit Interface Implementations

#### IPlayerLoopItem.MoveNext()

    bool IPlayerLoopItem.MoveNext()

##### Returns

System.Boolean

### Implements

System.IDisposable
IPlayerLoopItem