[fpc-pascal]getprocesstimes- help wanted pls

Lee, John LeeJ at logica.com
Wed Apr 11 20:05:12 CEST 2001

I'm trying to use this (in win 2000) to get process times, but can't seem to
make it work. Can anyone send me a simple fpc code fragment or a suggestion
that works to get the times into the int64 variables... guess I'm not
getting my pointers right!  TIA 

var t1,t2,t3,t4:int64;
... get myhndl for process...

tmpb:=getprocesstimes(myhndl, at t1, at t2, @t3, at t4);  

gives tmpb true (ie success) but the values in t1..t4 are always the same

The GetProcessTimes function obtains timing information about a specified
BOOL GetProcessTimes(

    HANDLE  hProcess,	// specifies the process of interest 
    LPFILETIME  lpCreationTime,	// when the process was created
    LPFILETIME  lpExitTime,	// when the process exited 
    LPFILETIME  lpKernelTime,	// time the process has spent in kernel mode

    LPFILETIME  lpUserTime 	// time the process has spent in user mode 

More information about the fpc-pascal mailing list