test: Calculate timeout in milliseconds