Matrix Science Mascot Parser toolkit
 
Loading...
Searching...
No Matches
config_procs.cs

Determine computer processor information.

/*
##############################################################################
# file: config_modprocs.cs #
# 'msparser' toolkit example code #
##############################################################################
# COPYRIGHT NOTICE #
# Copyright 1998-2015 Matrix Science Limited All Rights Reserved. #
# #
##############################################################################
# $Source: parser/examples/test_csharp/config_procs.cs $ #
# $Author: villek@matrixscience.com $ #
# $Date: 2018-07-30 16:23:53 +0100 $ #
# $Revision: 1b450440f9c97e1e41d0fc6016a27d68951d4532 | MSPARSER_REL_3_0_0-2024-09-24-0-g93ebaeb4f4 $ #
# $NoKeywords:: $ #
##############################################################################
*/
using System;
using matrix_science.msparser;
namespace MsParserExamples
{
public class config_procs
{
public static void Main(string[] argv)
{
// Don't check for Linux hyperthreading
ms_processors cpus = new ms_processors(false, 1);
if (!cpus.isValid())
{
Console.WriteLine("There are errors. Cannot continue. The last error description:");
Console.WriteLine(cpus.getLastErrorString());
return;
}
Console.WriteLine("Number of CPUs available on the system: {0}", cpus.getNumOnSystem());
}
}
}
/*
Running the program as
config_procs.exe
On a dual core Microsoft Windows system with hyperthreading will give the following output:
Number of CPUs available on the system: 4
*/