Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 342 Bytes

unix-time.md

File metadata and controls

21 lines (14 loc) · 342 Bytes

unixTime

Signature

function unixTime() external returns (uint milliseconds);

Description

Returns the time since unix epoch in milliseconds.

Examples

uint start = vm.unixTime();
vm.sleep(10_000); // Halts execution for 10 seconds
uint end = vm.unixTime();
assertEq(end - start, 10_000);