<!--
{
  "availability" : [
    "DriverKit: -",
    "iOS: -",
    "iPadOS: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "DriverKit",
  "identifier" : "/documentation/DriverKit/IOTimerDispatchSource/WakeAtTime",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "DriverKit"
    ],
    "preciseIdentifier" : "c:@S@IOTimerDispatchSource@F@WakeAtTime#k#k#k#"
  },
  "title" : "WakeAtTime"
}
-->

# WakeAtTime

Schedules a callback from the timer.

```
virtual kern_return_t WakeAtTime(uint64_t options, uint64_t deadline, uint64_t leeway);
```

## Parameters

`options`

The timebase to use when interpreting the `deadline` and `leeway` parameters. For a list of possible values, see [Clock Types](/documentation/DriverKit/3242783-clock_types).

`deadline`

The time at which to execute your action. The meaning of this parameter depends on the timebase you specified in the `options` parameter.

`leeway`

The maximum amount of time beyond the scheduled `deadline` that the system may wait before executing your action. Leeway values improve the system’s power usage by letting the system schedule timers at a more advantageous time. The system guarantees the execution of the timer’s action before the combined `deadline` and `leeway` values expire.

## Return Value

[`kIOReturnSuccess`](/documentation/DriverKit/kIOReturnSuccess) on success, or another value if an error occurs. See [Error Codes](/documentation/DriverKit/error-codes).

## Discussion

Use this method to schedule the execution time for your timer. Call this method from a block running on the same dispatch queue you passed to the [`Create`](/documentation/DriverKit/IOTimerDispatchSource/Create) method. If a previously scheduled timer has not yet fired, calling this method replaces the old time with the new value.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)