Constrain sleep time

Only values from 0 to 1 are allowed.