Hi Vlad,
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:
http://stackoverflow.com/questions/15030123/how-does-the-clock-function-in-ctime-access-the-system-c...
Regards,
Martin