Alternative to calculating Elapsed time using QueryPerformanceCounter
returns a monotonically increasing tick count.
Current we are using above mentioned Performance Counter and Performance
Frequency using “Kernel32.dll”. Basically we
use QueryPerformanceCounter to get a high resolution timer value
before and after the event you want to time. Then
use QueryPerformanceFrequency to get the number of ticks per second.
Divide the time difference by this value to convert the value to seconds.
alternatively we have thought to use stopwatch
to achive same on Linux using mono framrwork
Alternative way of
Performance Counter and Performance Frequency by using System. Diagnostics.
Following are the code to find the same.
System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();
double elapsedMs = watch.ElapsedTicks;
However result we are getting
on windows using QueryPerformanceCounter and on Linux using Stopwatch have
different precision Please find screenshot below.