---
title: "hv_vcpu_get_vtimer_offset(_:_:)"
framework: hypervisor
role: symbol
role_heading: Function
path: "hypervisor/hv_vcpu_get_vtimer_offset(_:_:)"
---

# hv_vcpu_get_vtimer_offset(_:_:)

Returns the vTimer offset for the vCPU ID you specify.

## Declaration

```swift
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

Return Value 0 on success, or an error code of the type hv_return_t.

## Discussion

Discussion This corresponds to the value of the CNTVOFF_EL2 register.

## See Also

### Timer functions

- [hv_vcpu_get_vtimer_mask(_:_:)](hypervisor/hv_vcpu_get_vtimer_mask(_:_:).md)
- [hv_vcpu_set_vtimer_mask(_:_:)](hypervisor/hv_vcpu_set_vtimer_mask(_:_:).md)
- [hv_vcpu_set_vtimer_offset(_:_:)](hypervisor/hv_vcpu_set_vtimer_offset(_:_:).md)
