/// <summary>
 /// 构造运行时及时信息更新事件参数。
 /// </summary>
 /// <param name="timelyInfo"></param>
 public TimelyInfoUpdatedEventArgs(RuntimeTimelyInfo timelyInfo)
 {
     TimelyInfo = timelyInfo;
     UpdateTime = DateTime.Now;
 }
        private static void UpdateRuntimeTimelyInfo()
        {
            while (keepUpdating)
            {
                float usage = GetCpuUsage();
                float privatePhysicalMemory =
                    (float)(Process.GetCurrentProcess().PrivateMemorySize64 / 1024.00 / 1024.00);
                ComputerInfo computerInfo = new ComputerInfo();
                float usedPhysicalMemory =
                    (float)((computerInfo.TotalPhysicalMemory - computerInfo.AvailablePhysicalMemory) / 1024.00 / 1024.00);
                timelyInfo = new RuntimeTimelyInfo();
                timelyInfo.CpuUsage = usage;
                timelyInfo.PrivatePhysicalMemory = privatePhysicalMemory;
                timelyInfo.UsedPhysicalMemory = usedPhysicalMemory;

                TimelyInfoUpdatedEventArgs e = new TimelyInfoUpdatedEventArgs(timelyInfo);
                OnTimelyInfoUpdated(e);

                Thread.Sleep(TimelyInfoUpdateInterval);
            }
        }