func ToTS(t time.Duration, clockRate uint64) uint64 {
	hi, lo := bits.Mul64(uint64(t), clockRate)
	ts, rem := bits.Div64(hi, lo, uint64(time.Second))
	if rem >= uint64(time.Second/2) {
		ts++
	}
	return ts
}
ToTS converts a duration to a number of clock ticks at a rate of clockRate
package internal
import (
	"math/bits"
	"time"
)