utility function to get current time in milliseconds, i forget why