---
title: SetClockAlgorithm
framework: audiodriverkit
role: symbol
role_heading: Instance Method
path: audiodriverkit/iouseraudioclockdevice/setclockalgorithm
---

# SetClockAlgorithm

Sets the clock algorithm of the clock device.

## Declaration

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

## Parameters

- `in_clock_algorithm`: The clock algorithm to set.

## Return Value

Return Value kIOReturnSuccess on success, or another value if an error occurs. For a list of error codes, see Error Codes.

## Discussion

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

## See Also

### Working with Clock Device Behavior

- [GetClockAlgorithm](audiodriverkit/iouseraudioclockdevice/getclockalgorithm.md)
- [IOUserAudioClockAlgorithm](audiodriverkit/audiodriverkit/iouseraudioclockalgorithm.md)
- [SetClockIsStable](audiodriverkit/iouseraudioclockdevice/setclockisstable.md)
- [GetClockIsStable](audiodriverkit/iouseraudioclockdevice/getclockisstable.md)
