This commit is contained in:
spiritlhl
2024-05-04 11:54:12 +00:00
parent 81213bfb6b
commit 1da46b62a1
3 changed files with 43 additions and 17 deletions

View File

@@ -47,7 +47,7 @@ func getCpuInfo(ret *model.SystemInfo, cpuType string) (*model.SystemInfo, error
if len(ret.CpuModel) < len(ci[i].ModelName) {
ret.CpuModel = ci[i].ModelName + fmt.Sprintf(" %d %s Core", len(ci), cpuType) + " @ " +
strconv.FormatFloat(ci[i].Mhz, 'f', 2, 64) + " MHz"
ret.CpuCores = fmt.Sprintf("%d vCPU(s)", int(ci[i].Cores))
ret.CpuCores = fmt.Sprintf("%d vCPU(s)", runtime.NumCPU())
if ci[i].CacheSize != 0 { // Windows查不到CPU的三缓
ret.CpuCache = string(ci[i].CacheSize)
}