Use time instead of deprecated timeout