I have a need to get the number of CPU cycles used by a specific process using C# (or VB.Net). This information is available in the Process properties popup within Sysinternal\
Process Explorer calls QueryProcessCycleTime to get that information. You will probably have to use P/Invoke to call it. I would expect its P/Invoke signature to look like:
[DllImport("kernel32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool QueryProcessCycleTime(IntPtr ProcessHandle, out ulong CycleTime);
There is a CodeProject article here: http://www.codeproject.com/KB/system/processescpuusage.aspx
I think this article will help you do exactly what you are trying to do. Basically they show you 2 ways to do it, one using the managed System.Diagnostics tools and the second using a Win API method call.
You will need to query the performance counters inside the CPUs. This is low level and very hardware specific, so you'll have to thunk to native code to get it. PAPI is the closest thing to a portable library for this task.
Be aware that context switches can change many of these internal CPU registers, so you'll need to do this query from inside your process. Querying the CPU counters from a different process will give you spurious results.
Remember also that CPU cycle count is not the same as (and on the x86, isn't even similar to) "number of instructions performed."