Skip to content
lstrojnyPublic

About

A small C library for nanosecond precise, cross platform timestamps

Resources

Stars

6 stars

Watchers

3 watching

Forks

Latest commit

 

History

40 Commits

Folders and files

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/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

Stars

6 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages