Fixed timeval to milliseconds calculation error

milliseconds = seconds * 1000 + microseconds / 1000