It's a good habit to either specifically declare what units time is in, e.g. period_ms, or to add a comment that does this. This way the user  has an easier time with the units. And mistakes such as dividing period by 1000 twice, such as is done here (whoops!), are more easily avoided.