Solution of Sleep
IntuitionTo initialize millis parameter as milliseconds that should count until returning the promise.ApproachStarting to count millis with usage of SetTimeout
# Intuition
To initialize millis parameter as milliseconds that should count until returning the promise.

# Approach
Starting to count millis with usage of SetTimeout function,then resolve it and return new promise.

# Complexity
- Time complexity:
O(1) because of number of operations

- Space complexity:
O(1) because of constant usage of space.

# Code
```javascript []
/**
 * @param {number} millis
 * @return {Promise}
 */
async function sleep(millis) {
    return new Promise(resolve => setTimeout(resolve, millis)); // Returning a promise with usage of SetTimeout method
}

/** 
 * let t = Date.now()
 * sleep(100).then(() => console.log(Date.now() - t)) // 100
 */
```
['JavaScript']