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.
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: