durstr
A simple library for parsing human-readable duration strings into std::time::Duration.
Usage
Add durstr to Cargo.toml:
[]
= "0.2.0"
Then use the parse function:
use parse;
use Duration;
let dur = parse;
assert_eq!;
let dur = parse;
assert_eq!;
Supported Units
| Unit | Aliases |
|---|---|
| Millisecond | ms, msec/msecs, milliseconds |
| Second | s, sec/secs, seconds |
| Minute | m, min/mins, minutes |
| Hour | h, hr/hrs, hours |
Future Enhancements
- Floating point support
- User-defined custom units
- Case sensitivity option