[....]
// MESSVORGANG START ....
QueryPerformanceFrequency(Freq_FPC);
QueryPerformanceCounter(Start_FPC);
// Datei öffnen:
ShellExecute(0,
Nil,PCHar(frm_main.Edit_filename.Text),
Nil,
Nil,SW_NORMAL);
start_gtk := gettickcount;
ACT_GTK := Start_GTK;
i := 1;
prot_string := '
';
while IsExeRunning(EXE_string) = true
do
begin
x:= strtoint(ComboBox_intervall.text);
// Immer nur alle x Millisekunden eine Messung. Sonst erzeugt die
// Messung zuviel CPU Last und verfälscht so das Ergebnis
// --> zu grosser Rucksack!
if (GetTickCount - ACT_GTK) >= x
then
begin
ACT_GTK := GetTickCount;
// RAM Werte spezifizerien:
if get_global_ram_usage_percentage > G_Max_ram_use
then
G_Max_ram_use := get_global_ram_usage_percentage;
if get_global_ram_usage_percentage < G_Min_ram_use
then
G_Min_ram_use := get_global_ram_usage_percentage;
// CPU Werte spezifizerien:
G_Act_cpu_use := GetSystemCPUUsage;
G_AVG_cpu_use := G_AVG_cpu_use + G_Act_cpu_use;
if G_Act_cpu_use > G_Max_cpu_use
then
G_Max_cpu_use := G_Act_cpu_use;
if G_Act_cpu_use < G_Min_cpu_use
then
G_Min_cpu_use := G_Act_cpu_use;
// VRAM WERTE setzen:
G_Act_vram_use := get_global_vram_usage_percentage;
G_AVG_vram_use := G_AVG_vram_use + G_Act_vram_use;
if G_Act_vram_use > G_Max_vram_use
then
G_Max_vram_use := G_Act_vram_use;
if G_Act_vram_use < G_Min_vram_use
then
G_Min_vram_use := G_Act_vram_use;
// PAGE WERTE setzen:
G_Act_page_use := get_global_page_usage_percentage;
G_AVG_page_use := G_AVG_page_use + G_Act_page_use;
if G_Act_page_use > G_Max_page_use
then
G_Max_page_use := G_Act_page_use;
if G_Act_page_use < G_Min_page_use
then
G_Min_page_use := G_Act_page_use;
// Charts aktualisierern:
chart_vram.Series[0].AddXY(i, G_Act_vram_use, '
', clTeeColor); chart_vram.Update; chart_vram.BottomAxis.Maximum := i ;
chart_page.Series[0].AddXY(i, G_Act_page_use, '
', clTeeColor); chart_page.Update; chart_page.BottomAxis.Maximum := i ;
chart_cpu.Series[0].AddXY(i, G_Act_cpu_use, '
', clTeeColor); chart_cpu.Update; chart_cpu.BottomAxis.Maximum := i ;
chart_ram.Series[0].AddXY(i, get_global_ram_usage_percentage, '
', clTeeColor); chart_ram.Update; chart_ram.BottomAxis.Maximum := i ;
inc(i);
end;
end;
stop_gtk := gettickcount;
QueryPerformanceCounter(Stop_FPC);
// MESSVORGANG ENDE ....
[...]