/* Given a period in ns and frequency in khz, calculate the number of cycles of frequency in period. Note that we round up to the next cycle, even if we are only slightly over.  */
static u_int ns_to_cycles(u_int ns, u_int khz)
/* Given a period in ns and frequency in khz, calculate the number of cycles of frequency in period. Note that we round up to the next cycle, even if we are only slightly over.  */
static u_int ns_to_cycles(u_int ns, u_int khz)
{
	return (ns * khz + 999999) / 1000000;
}