mirror of
https://github.com/ARM-software/devlib.git
synced 2025-03-06 02:07:51 +00:00
Add the monotonic clock time to the energy measurements to help correlate the measurement with those of other collectors, like FtraceCollector or LogcatCollector.
19 lines
322 B
C
19 lines
322 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <time.h>
|
|
|
|
int main(void) {
|
|
int ret;
|
|
struct timespec tp;
|
|
|
|
ret = clock_gettime(CLOCK_MONOTONIC, &tp);
|
|
if (ret) {
|
|
perror("clock_gettime()");
|
|
return EXIT_FAILURE;
|
|
}
|
|
|
|
printf("%ld.%ld\n", tp.tv_sec, tp.tv_nsec);
|
|
|
|
return EXIT_SUCCESS;
|
|
}
|