Home » Julia

Sys.CPU_THREADS Constant in Julia

Julia | Sys.CPU_THREADS Constant: In this tutorial, we are going to learn about the Sys.CPU_THREADS constant with examples in Julia programming language.
Submitted by IncludeHelp, on April 02, 2020

Julia | Sys.CPU_THREADS Constant

Sys.CPU_THREADS is a constant of the Int64 type in Julia programming language, it is used to get the number of cores available in the system / the number of threads that the CPU can run concurrently.

Syntax:

    Sys.CPU_THREADS

Example:

In this example, we are taking a variable x and assigning it with Sys.CPU_THREADS. We are printing the value and type of x using using println() function and typeof() function.

# Julia example of Sys.CPU_THREADS

x = Sys.CPU_THREADS

println("x: ", x)
println("typeof(x): ", typeof(x))

Output

x: 4
typeof(x): Int64

Reference: Julia constants



Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.