Use timcop instead of sleep