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