<!--
{
  "availability" : [
    "macOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Hypervisor",
  "identifier" : "/documentation/Hypervisor/hv_vcpu_get_vtimer_offset(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Hypervisor"
    ],
    "preciseIdentifier" : "c:@F@hv_vcpu_get_vtimer_offset"
  },
  "title" : "hv_vcpu_get_vtimer_offset(_:_:)"
}
-->

# hv_vcpu_get_vtimer_offset(_:_:)

Returns the vTimer offset for the vCPU ID you specify.

```
func hv_vcpu_get_vtimer_offset(_ vcpu: hv_vcpu_t, _ vtimer_offset: UnsafeMutablePointer<UInt64>) -> hv_return_t
```

## Parameters

`vcpu`

The ID of the vCPU instance.

`vtimer_offset`

A pointer to vTimer offset; the Hypervisor writes to this value on success.

## Return Value

`0` on success, or an error code of the type [`hv_return_t`](/documentation/Hypervisor/hv_return_t).

## Discussion

This corresponds to the value of the `CNTVOFF_EL2` register.

---

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)