Skip to content

AidosKuneen/numcpu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golangci lint Tests Coverage Status GoDoc GitHub license

NumCPU

Overview

numcpu.NumCPU() returns the number of logical CPUs usable by the current process.

Android doesn't return max number of CPUs by runtime.NumCPU(), but just returns number of "working" CPUs. So this library checks sysfs directory directly for linux, and just returns runtime.NumCPU() for others.

Requirements

  • git
  • go

are required to compile.

Install

$ go get -u github.com/AidosKuneen/numcpu

Usage

	import "github.com/AidosKuneen/numcpu"
	n:=numcpu.NumCPU()

Dependencies and Licenses

Golang Standard Library       BSD 3-clause License

About

runtime.NumCPU() for android

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages