Counter

The Counter class is used to track the number of the clock ticks.

Counter.swift:28
final class Counter

It is actually a hardware timer. The clock tick is derived from hardware clock cycle. To create a counter, you can directly specify the counter’s period in microsecond.

// Initialize a periodic counter with a default period of 1s.
let counter = Counter(Id.C0)

The counter is suitable for some situation that requires more accurate time, but cannot track too long (usually several seconds) in case of overflow.