He is not running a ‘Real-Time’ system. This seems like a reasonable method to test how fast module runs. EDIT :- I didn’t see LARSC reply before posting. He IS trying to run a Real-Time system from NETMF. The G120 uProc does have dedicated motor control hardware peripheral but I do not know how to use it.
I tested this myself with slightly modified code and got 9KHz rather than 4.5KHz…I also measured about 33KHz when running a loop of a single integer addition or multiplication.
What I will say is that small functions like these are dominated by the interpreter overhead. More complex function such as say Bitmap.Flush() are much more comparable to the performance you would get when writing native code.
You can use RLP to boost the performance of critical code segments if you need.