Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
C str to us / ms utilities
C Makefile
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
.travis.yml
History.md
Makefile
Readme.md
ms.c
ms.h
package.json
test.c

Readme.md

ms

Convert strings like "15s" to seconds, milliseconds, or microseconds, and convert milliseconds to strings ("300ms", "5ms") or long strings ("5 seconds", "1 month").

Installation

Install with clib:

$ clib install clibs/ms

API

long long
string_to_microseconds(const char *str);

long long
string_to_milliseconds(const char *str);

long long
string_to_seconds(const char *str);

char *
milliseconds_to_string(long long ms);

char *
milliseconds_to_long_string(long long ms);

For usage view the tests

Something went wrong with that request. Please try again.