Instance Method

duration

Returns the total duration covering all the samples that match the query.

Declaration

- (HKQuantity *)duration;

Discussion

If you set the HKStatisticsOptionDuration option, this method returns a quantity object containing total duration covering all the samples that match the query; otherwise, it returns nil.

See Also

Getting Statistics Data

- averageQuantity

Returns the average value from all the samples that match the query.

- averageQuantityForSource:

Returns the average value from all the samples that match the query and that were created by the specified source.

- maximumQuantity

Returns the maximum value from all the samples that match the query.

- maximumQuantityForSource:

Returns the maximum value from all the samples that match the query and that were created by the specified source.

- minimumQuantity

Returns the minimum value from all the samples that match the query.

- minimumQuantityForSource:

Returns the minimum value from all the samples that match the query and that were created by the specified source.

- sumQuantity

Returns the sum of all the samples that match the query.

- sumQuantityForSource:

Returns the sum of all the samples that match the query and that were created by the specified source.

- durationForSource:

Returns the total duration covering all the samples created by the specified source that also match the query.