АЯ
Анна Яковлева

Как на PureBasic или на Delphi 7 получить уровень нагрузки ЦП, видеопамяти, ОЗУ?



Вообще-то в Purebasic есть функция CpuUsage() но у меня работать не хочет, может, потому что система x64, а PureBasic x86 (если вообще бывает 64-битный :)))))

ДБ
Денис Буланцев

GetSystemTimes Function

Retrieves system timing information. On a multiprocessor system, the values returned are the sum of the designated times across all processors.

BOOL WINAPI GetSystemTimes(
__out LPFILETIME lpIdleTime,
__out LPFILETIME lpKernelTime,
__out LPFILETIME lpUserTime
);

Parameters
lpIdleTime
A pointer to a FILETIME structure that receives the amount of time that the system has been idle.

lpKernelTime
A pointer to a FILETIME structure that receives the amount of time that the system has spent executing in Kernel mode (including all threads in all processes, on all processors).

lpUserTime
A pointer to a FILETIME structure that receives the amount of time that the system has spent executing in User mode (including all threads in all processes, on all processors).

Return Value
If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

-------------------------------------------------
Library
Use Kernel32.lib.

DLL
Requires Kernel32.dll.

-------------------------------------------------
enjoy ^_^

Virys
Virys

С памятью проще всего. http://purebasic.info/phpBB2/viewtopic.php?p=37198#37198

memex.MEMORYSTATUSEX
memex\dwLength = SizeOf(MEMORYSTATUSEX)
GlobalMemoryStatusEx_(@memex)
txt.s = Str(memex\dwMemoryLoad) + "%" + " Использованно памяти"+ Chr(10)
txt = txt + Str(memex\ullTotalPhys/1024) + " Доступно физической памяти (в килобайтах) "+ Chr(10)
txt = txt + Str(memex\ullTotalPageFile/1024) + " Всего виртуальной памяти (в килобайтах) "+ Chr(10)
txt = txt + Str(memex\ullAvailPageFile/1024) + " Доступно виртуальной памяти (в килобайтах) "+ Chr(10)
txt = txt + Str(memex\ullTotalVirtual/1024) + " Адресное виртуальное простанство текущего процесса"+ Chr(10)
txt = txt + Str(memex\ullAvailVirtual/1024) + " Доступно байт виртуального адресного пространства текущего процесса"
MessageRequester("",txt,0)

Кроме того, начиная с версии 5.10, появилась кроссплатформенная функция MemoryStatus(). http://purebasic.com/documentation/system/memorystatus.html

Похожие вопросы
Где найти видеурок по Delphi 7 ???Где найти видеурок по Delphi 7 ???
Delphi 7 FileListBox
Delphi 7 PageControl
Подскажите по Delphi 7
программирование на Delphi 7
Как на PureBasic\Delphi сделать вот такое окошко?
помогите по Delphi 7
Могут зависать игры из за ЦП? и его нагрузки!
Помогите. Delphi 7!!!
Почему на ноутбуке нагрузка ЦП на 100% и занимает 30-40% ОЗУ