Contiki 2.5
test_arch.c
1 #include "test.h"
2 #include "watchdog.h"
3 #include "clock.h"
4 
5 uint32_t test_precise_timestamp() {
6  clock_time_t now;
7  clock_time_t now_fine;
8 
9  do {
10  now_fine = clock_time();
11  now = clock_seconds();
12  } while (now_fine != clock_time());
13 
14  return ((unsigned long)now)*CLOCK_SECOND + now_fine%CLOCK_SECOND;
15 }