Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

C str to us / ms utilities

branch: master

docs

latest commit 6ba9d290c3
TJ Holowaychuk visionmedia authored October 10, 2013
Octocat-spinner-32 .gitignore add ignore *.o September 17, 2012
Octocat-spinner-32 History.md Release 0.0.3 January 25, 2013
Octocat-spinner-32 Makefile .PHONY: test September 16, 2012
Octocat-spinner-32 Readme.md docs October 10, 2013
Octocat-spinner-32 ms.c fix long long overflow January 25, 2013
Octocat-spinner-32 ms.h add missing string_to_seconds() proto September 17, 2012
Octocat-spinner-32 package.json docs October 10, 2013
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.