Type Method

secondUnitWithMetricPrefix:

Returns a HealthKit unit for measuring time, using second units with the provided prefix.

Declaration

+ (instancetype)secondUnitWithMetricPrefix:(HKMetricPrefix)prefix;

Parameters

prefix

A valid metric prefix value. For the complete list of prefix values, see HKMetricPrefix.

Return Value

A HealthKit unit for measuring time based on seconds and the provided prefix.

Discussion

This method is used to create prefixed versions of seconds. Common uses include creating millisecond units, as shown below.

HKUnit *ms = [HKUnit secondUnitWithMetricPrefix:HKMetricPrefixMilli];

See Also

Constructing Time Units

+ secondUnit

Returns a HealthKit unit for measuring time in seconds.

+ minuteUnit

Returns a HealthKit unit for measuring time in minutes.

+ hourUnit

Returns a HealthKit unit for measuring time in hours.

+ dayUnit

Returns a HealthKit unit for measuring time in days.