Exemple #1
0
 /// <summary>
 /// Creates and returns a CpuUsage instance that can be used to query the CPU time on this operating system.
 /// </summary>
 /// <returns>An instance of the CpuUsage class.</returns>
 /// <exception cref="NotSupportedException">This platform is not supported -or- initialization of the CPUUsage object failed.</exception>
 public static CpuUsage Create()
 {
     if (m_CpuUsage == null)
     {
         if (Environment.OSVersion.Platform == PlatformID.Win32NT)
             m_CpuUsage = new CpuUsageNt();
         else if (Environment.OSVersion.Platform == PlatformID.Win32Windows)
             m_CpuUsage = new CpuUsage9x();
         else
             throw new NotSupportedException();
     }
     return m_CpuUsage;
 }
Exemple #2
0
 /// <summary>
 /// Creates and returns a CpuUsage instance that can be used to query the CPU time on this operating system.
 /// </summary>
 /// <returns>An instance of the CpuUsage class.</returns>
 /// <exception cref="NotSupportedException">This platform is not supported -or- initialization of the CPUUsage object failed.</exception>
 public static CpuUsage Create()
 {
     if (m_CpuUsage == null)
     {
         if (Environment.OSVersion.Platform == PlatformID.Win32NT)
         {
             m_CpuUsage = new CpuUsageNt();
         }
         else if (Environment.OSVersion.Platform == PlatformID.Win32Windows)
         {
             m_CpuUsage = new CpuUsage9x();
         }
         else
         {
             throw new NotSupportedException();
         }
     }
     return(m_CpuUsage);
 }