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  do {
9  now_fine = clock_time();
10  now = clock_seconds();
11  } while (now_fine != clock_time());
12 
13  return ((unsigned long)now)*CLOCK_SECOND + now_fine%CLOCK_SECOND;
14 }