convert the time difference to milliseconds