Monotonic Time

Table of Contents

Monotonic Time

System.monotonic_time/1 Returns the current monotonic time in the given time unit. The time is monotonically increasing and starts in an unspecified point in time.

start_time = System.monotonic_time(:microseconds)

# do something

end_time = System.monotonic_time(:microseconds)

duration_in_microseconds = end_time - start_time