Process memory usage
GetProcessWorkingSetSize() SetProcessWorkingSetSize()
h,mMin,mMax:cardinal;
h:=OpenProcess(PROCESS_QUERY_INFORMATION or PROCESS_VM_READ, false, PID);
GetProcessWorkingSetSize(h,mMin,mMax);
CloseHandle(h);
h,newMin,newMax:cardinal;
h:=OpenProcess(PROCESS_QUERY_INFORMATION or PROCESS_SET_QUOTA, false, PID);
SetProcessWorkingSetSize(h, newMin, newMax);
https://w-shadow.com/blog/2006/09/04/process-memory-usage/
GetSystemTimes to get the total system timing.
GetProcessTimes to get timing for a specific process.
GetCurrentProcess to get current process handle.
PerfCounter Performance Counter
https://docs.microsoft.com/zh-tw/troubleshoot/windows-server/performance/manually-rebuild-performance-counters
https://www.codeproject.com/articles/9113/get-cpu-usage-with-getsystemtimes
https://docs.microsoft.com/en-us/windows/win32/perfctrs/about-performance-counters
https://www.codeproject.com/Articles/10538/Getting-CPU-Usage-in-a-Multiprocessor-Machine
https://www.codeproject.com/search.aspx?q=cpu++usage&doctypeid=1%3b2%3b3%3b13%3b11%3b17