Fixed a bug in delay() which appears for values below 1000

Division with integers wont work if the result will be a floating point value below 1.

1000 / 1000 = 1
900 / 1000 = 0
900.0 / 1000 = 0.9