Home/Support/Support Forum/Processor time
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Processor time

0 votes

I'm using Connect ME 9210 with NET+OS.

I need to get processor clock time (number of ticks elapsed since the program was launched). So that I can compute how long the program has been running.
I noticed the function 'clock()' is used for this purpose, but I'm always getting zero.

Do I need to change some system configuration to make it work or is there any other way to get the processor time in NET+OS.

Thank you for answer
asked Dec 21, 2016 in NET+OS by stepik New to the Community (4 points)

Please log in or register to answer this question.

1 Answer

+1 vote
Best answer
Look at ULONG tx_time_get(void);

Or, for time in seconds:
unsigned long ns_get_uptime_sec(void);

in sys/util/nsuptime.*
answered Dec 22, 2016 by steved2 Seasoned Professional (183 points)
selected Dec 22, 2016 by stepik
Thanks very much.
ns_get_uptime_sec() is exactly what I needed.