a question about the ClockTime function

Hi

I met a problem with the ClockTime function.
It works fine when the system is not loaded.
It return error code ESRCH, when the system is busy.
According to the QNX documentation, ESRCH means “The process associated with this request doesn’t exist”. I don’t know what it means. The program has only one main function.

Any suggestion?

Thank you!

Iris

What clockid is given as parameter?

I presume the ID given is not valid anymore.

ClockTime(CLOCK_REALTIME,NULL, &timeInNsec)

I try both CLOCK_REALTIME, and CLOCK_MONOTONIC.
timeInNsec is a global uint64_t

What do you mean by “not valid”. As long as I reduce the load of the system, the program runs well again.

Try clock_gettime(), is will be same result?

I discovered a bug in my code. I read the error code of other operations, not ClockTime.
ClockTime is working fine. Sorry for the confusion.
Please delete the post.