2022-10-19 19:11:38 +00:00
|
|
|
#include <stdio.h>
|
2022-10-30 08:09:03 +00:00
|
|
|
#include <time.h>
|
2022-10-19 19:11:38 +00:00
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
2022-10-30 08:09:03 +00:00
|
|
|
struct timespec tp;
|
|
|
|
clock_gettime(CLOCK_MONOTONIC, &tp); // On Luna, CLOCK_MONOTONIC starts at boot.
|
2022-10-19 19:11:38 +00:00
|
|
|
|
2022-10-30 08:09:03 +00:00
|
|
|
printf("up for %ld seconds\n", tp.tv_sec);
|
2022-10-19 19:11:38 +00:00
|
|
|
}
|