Converts anything* to microseconds and back.
Tired of implementing the same timestamp conversion functions in different projects under different names? I was, hence this tiny library.
megaseconds() :: non_neg_integer()
seconds() :: non_neg_integer()
milliseconds() :: non_neg_integer()
microseconds() :: non_neg_integer()
now_timestamp() :: {megaseconds(), seconds(), microseconds()}
usec:from_msec/1 % Convert milliseconds() to microseconds().
usec:to_msec/1 % Convert microseconds() to milliseconds().
usec:from_now/1 % Convert now_timestamp() to microseconds().
usec:to_now/1 % Convert microseconds() to now_timestamp().
usec:from_sec/1 % Convert seconds() to microseconds().
usec:to_sec/1 % Convert microseconds() to seconds().
This project uses rebar and the awesome universal erlang makefile by erlware.
make compile
compiles the librarymake dialyzer
type-checks the codemake doc
builds the beautiful edoc documentationmake test
runs the unit tests, writes coverage report to.eunit/index.html