Practice Sleep
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Easy#2621
LeetCode ProblemSleep
Problem Statement
Given a positive integer millis, write an asynchronous function that sleeps for millis milliseconds. It can resolve any value. Note that minor deviation from millis in the actual sleep duration is acceptable.
Source: Sleep on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
Input
millis = 100
Output
100
# Example 2
Input
millis = 200
Output
200
Constraints
1 <= millis <= 1000
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.