numcpu

package module
v0.0.0-...-d614971 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2021 License: MIT Imports: 4 Imported by: 5

README

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NumCPU

func NumCPU() int

NumCPU returns the number of logical CPUs usable by the current process. Android doesn't return max CPU by runtime.NumCPU(), but just returns number of working CPUs. So this checks sysfs directly for linux.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL