Skip to content
forked from lstrojny/nanotime

A small C library for nanosecond precise, cross platform timestamps

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
COPYING
Notifications You must be signed in to change notification settings

chamnan/nanotime

 
 

Repository files navigation

nanotime Build Status

A small C library for nanosecond precise, cross platform timestamps

Examples

Include file

Include nanotime.h to use

#include <nanotime.h>

Get current timestamp

Get current UNIX timestamp as a long double with nanotime precision.

long double timestamp;
if (NANO_UNEXPECTED(nano_time(&timestamp)) {
    // Error handling
}
printf("Current time: %f\n", timestamp);

Get current nanosecond

Get current nanosecond as an unsigned long.

unsigned long sec;
if (NANO_UNEXPECTED(nano_second(&sec)) {
    // Error handling
}
printf("Current time: %Ld\n", sec);

About

A small C library for nanosecond precise, cross platform timestamps

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
COPYING

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published