# Time

`com.jsmacrosce.jsmacros.core.library.impl.FTime`

Provides wall-clock time utilities to scripts as `Time`.  
 
 [time()](#com.jsmacrosce.jsmacros.core.library.impl.FTime_time-) returns system time in milliseconds since the Unix epoch; [sleep(long)](#com.jsmacrosce.jsmacros.core.library.impl.FTime_sleep-long-)
 waits in milliseconds rather than game ticks. In the Graal context, sleeping yields execution
 to other script threads while the calling script waits.  
 ```js
const started = Time.time();  
Time.sleep(1000);  
print(`that took about ${Time.time() - started} ms`);  
 ```

Accessible in scripts via the global `Time` variable.

## Methods

### sleep {#com.jsmacrosce.jsmacros.core.library.impl.FTime_sleep-long-}

```js
sleep(long millis): void
```

Waits for the specified wall-clock duration; this is not a tick-based delay. In the Graal
 context, the language engine is yielded to other script threads while waiting.  
 Closing the script context can interrupt a sleeping bound thread.

**Parameters:**
- `millis`: how long to sleep for, in milliseconds

### time {#com.jsmacrosce.jsmacros.core.library.impl.FTime_time-}

```js
time(): long
```

**Returns:** milliseconds since the Unix epoch, from the system wall clock
