I\'m using TotalProcessorTime to mesure time speding by a method in cpu.
for(int i=0;i<10;i++){
double s = Process.getCurrentProcess().TotalProcessorT
I am almost certain you would want to use Stopwatch
, QueryPerformanceCounter
, or alike for what you desire. However, the granularity of TotalProcessorTime
can be modified:
The granularity/resolution is determined by the systems timer resolution. This Accurate Windows timer?... answer shows how to obtain and how to modify the systems timer resolution. Coding examples are given here (c) and here (c#).