How can I use time.h functions in S32 design studio? I tried clock() and also time() functions, but none of them works.
please look at the following thread. We have already solve this problem, so I hope it will help you. If not, please write me back.
It doesn't work. I am using also newlib, but with or without the two ewl libraries, time() function always returns -1 (error code).
Can you send me a configured project that contains time() or clock() function? I looket at that thread,but it didn't work.
sorry for my previous post. Return code -1 is correct, because the micro does not have any resources, how to return you correct time.
This is the clock function description:
This function returns the calling process' current CPU time. If the CPU time is not available or cannot be represented, clock returns the value (clock_t)(-1).
and this is the time function description:
The time function returns the current calendar time as a value of type time_t. If the argument result is not a null pointer, the calendar time value is also stored in *result. If the current calendar time is not available, the value (time_t)(-1) is returned.
So you cannot simply use these functions. The way, how to use these functions exists, but it will be pretty difficult and I do not have any experience with it. Please look at the follow URL:
Retrieving data ...