Ported from https://github.com/google/periph/issues/379. It is more correct. In v3.5.0, add the new method Period(). In v4.0.0, remove Duration().