---
title: SetClockAlgorithm
framework: VideoDriverKit
role: symbol
role_heading: Instance Method
platforms: [driverkit 27.0+]
path: videodriverkit/iouservideoclockdevice/setclockalgorithm
---

# SetClockAlgorithm

Sets the algorithm for the video clock device.

## Declaration

```occ
kern_return_t SetClockAlgorithm(IOUserVideoClockAlgorithm in_clock_algorithm);
```

## Parameters

- `in_clock_algorithm`: The IOUserVideoClockAlgorithm value to set.

## Return Value

Return Value A kern_return_t value indicating success or failure.

## Discussion

Discussion Drivers can change the clock algorithm of the clock device dynamically. If successful, the clock device sends a notification to the host to update the object state.

## See Also

### Working with clock device behavior

- [GetClockAlgorithm](videodriverkit/iouservideoclockdevice/getclockalgorithm.md)
- [IOUserVideoClockAlgorithm](videodriverkit/videodriverkit/iouservideoclockalgorithm.md)
- [SetClockIsStable](videodriverkit/iouservideoclockdevice/setclockisstable.md)
- [GetClockIsStable](videodriverkit/iouservideoclockdevice/getclockisstable.md)
