[Mono-osx] PerformanceCounter on OS X

Duane Wandless duane at wandless.net
Tue Feb 15 18:09:27 EST 2011


I've attempted to figure out how this is implemented on Leopard.  It appears
that get_cpu_times in mono/utils/mono-proclib.c relies on "/proc/stat".
 Which as far as I can tell does not exist on Snow Leopard.

The C# code is:

cpu = new PerformanceCounter("Process", "% Processor Time",
Process.GetCurrentProcess().ProcessName,
true);

   cpu.NextValue()


NextValue() is always 0.  But on Windows it does work as expected.


I may be misreading the code, I did not actually confirm this is the code
path taken.  Even if the code path is different NextValue is still always 0.


Any help would be appreciated.

Thanks,

Duane
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20110215/8d18e83e/attachment.html 


More information about the Mono-osx mailing list