while (x <10 && x <50)
How can I measure how many instructions a loop like and what the elapsed time is?
Or are there functions that we know precisely the time elapsed in NIOS II and how many instructions sets they consist of?
You can use alarms and related functions all documented in the software developer's handbook:
You can do it with Performance counter IP.
You can try Performance counter IP.
For more complete information about compiler optimizations, see our Optimization Notice.