Mercurial > repos > davidvanzessen > shm_csr
comparison show_time_as_float.c @ 93:8fcf31272f6e draft
planemo upload commit a43893724cc769bed8a1f19a5b19ec1ba20cb63c
author | rhpvorderman |
---|---|
date | Mon, 06 Mar 2023 11:36:32 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
92:cf8ad181628f | 93:8fcf31272f6e |
---|---|
1 /* script adapted from https://www.nu42.com/2021/07/windows-c-time-in-nanoseconds.html */ | |
2 #include <stdio.h> | |
3 #include <time.h> | |
4 | |
5 int main(void) | |
6 { | |
7 struct timespec ts; | |
8 | |
9 if (timespec_get(&ts, TIME_UTC) != TIME_UTC) | |
10 { | |
11 fputs("timespec_get failed!", stderr); | |
12 return 1; | |
13 } | |
14 printf("%ld.%ld\n", ts.tv_sec, ts.tv_nsec); | |
15 return 0; | |
16 } |