- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
ProcessorInfo ProcessorInfo::Get()
{
ProcessorInfo result;
String allCpuInfo = IO::DiskFile::ReadAsString("/proc/cpuinfo");
result.BrandString = allCpuInfo().Find(StringView("\nmodel name"))
.Find(':').Drop(2).ReadUntil('\n');
result.CoreNumber = allCpuInfo().Find(StringView("\ncpu cores"))
.Find(':').Drop(2).ReadUntil('\n').ParseAdvance<ushort>();
result.LogicalProcessorNumber = (ushort)allCpuInfo().Count(StringView("processor "));
result.Frequency = ulong64(1000000*allCpuInfo().Find(StringView("\ncpu MHz"))
.Find(':').Drop(2).ReadUntil('\n').ParseAdvance<double>());
return result;
}
guestinho 12.09.2016 13:50 # 0
gammaker 13.09.2016 20:02 # 0
guestinho 12.09.2016 13:52 # +1
gammaker 13.09.2016 20:03 # 0
BagorCtretora 15.09.2016 03:46 # +1
roman-kashitsyn 12.09.2016 13:55 # 0
> allCpuInfo()
Строка -- это функция без параметров?
guestinho 12.09.2016 14:00 # +1
gammaker 13.09.2016 20:02 # 0
BagorCtretora 15.09.2016 03:48 # 0
bagor 12.09.2016 14:36 # −34