Why I can't get the seconds and nanoseconds like this?

chenggh chenggh04 at st.lzu.edu.cn
Mon Jan 8 06:21:40 CET 2007

	I wrote the simple application like this. 

#include <stdio.h>
#include <l4/util/rdtsc.h>
#include <l4/sys/l4int.h>
#include <l4/thread/thread.h>

char LOG_tag[4]="clk";

int main(void)
        l4_uint32_t     *second;
        l4_uint32_t     *nanosecond;
        l4_cpu_time_t   tsc;
        tsc = l4_rdtsc();
        l4_tsc_to_s_and_ns(tsc, second, nanosecond);
        printf("%d, %d \n", *second, *nanosecond);

The result is :
clk     | 0, 0
clk     |
clk     | Exiting with 6
	Does these code have some problems?
	Thank you.

More information about the l4-hackers mailing list