<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKUnit/hertzUnit(with:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HKUnit(cm)hertzUnitWithMetricPrefix:"
  },
  "title" : "hertzUnit(with:)"
}
-->

# hertzUnit(with:)

Returns a HealthKit unit for measuring frequency in hertz with the provided prefix.

```
class func hertzUnit(with prefix: HKMetricPrefix) -> Self
```

## Parameters

`prefix`

A valid metric prefix value. For the complete list of prefix values, see [`HKMetricPrefix`](/documentation/HealthKit/HKMetricPrefix).

## Discussion

Hertz represent cycles per second.

---

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)