[][src]Crate ms_converter

Fast converter various time formats into milliseconds.

Macros

ms_expr

Zero cost converter from human-like time into a number. In the first argument, you need to pass type of your number (i64, f64 and etc). The second argument is human-time construction, like 1 day, 2 h. The output will be a number with type what you set in the first argument.

Structs

Error

Error what return ms converter functions in runtime, if something is going wrong.

Constants

DAY

How many milliseconds in one day

HOUR

How many milliseconds in one hour

MINUTE

How many milliseconds in one minute

SECOND

How many milliseconds in one second

WEEK

How many milliseconds in one week

YEAR

How many milliseconds in one year

Functions

ms

Fast abstraction for converting human-like times into milliseconds. ms function gets an str slice and returns how much milliseconds in your pattern.

ms_into_time

Ms into time is the abstraction on ms function, which converts result into time.Duration type. ms_into_time function gets an str slice and returns time.Duration. ms_into_time has some limitations, it's not working with negative values: