Пример #1
0
        public void PageUpdate()
        {
            //cpuUseage = (int)(MPERF_GetCpuUseAge2());

            if (!notDrawGrid)
            {
                if (showKernelTime)
                {
                    int cpuKernelTime = (int)(cpuUseage - MPERF_GetCpuUseAgeUser2());
                    performanceGridGlobal.AddData2(cpuKernelTime);
                }
                performanceGridGlobal.AddData(cpuUseage);
                performanceGridGlobal.Invalidate();
            }

            item_cpuuseage.Value = cpuUseage.ToString() + "%";
            if (MSystemPerformanctMonitor.UpdatePerformance())
            {
                item_process_count.Value = MSystemPerformanctMonitor.GetProcessCount().ToString();
                item_thread_count.Value  = MSystemPerformanctMonitor.GetThreadCount().ToString();
                item_handle_count.Value  = MSystemPerformanctMonitor.GetHandleCount().ToString();
                times = TimeSpan.FromMilliseconds(Convert.ToDouble(MSystemPerformanctMonitor.GetSystemRunTime()));
                item_run_time.Value = times.Days + ":" + times.Hours.ToString("00") + ":" + times.Minutes.ToString("00") + ":" + times.Seconds.ToString("00");
                if (cpuCount > 1)
                {
                    if (notDrawGrid)
                    {
                        performanceCpusAll.Invalidate();
                    }
                    else
                    {
                        performanceCpus.Invalidate();
                    }
                }
                performanceInfos.UpdateSpeicalItems();
            }
        }