# Control the number of threads being used in an R-session:
# set the number of threads to 1
## Not run:
# set_num_threads(1)
#
# #### Use a parallelized cpgen-function
#
# # generate random data
# rand_data(1000,10000)
#
# # check single-threaded performance
# system.time(W <- M%c%t(M))
#
# # set number of threads to 2
#
# set_num_threads(2)
#
# # check multi-threaded performance
# system.time(W <- M%c%t(M))
# ## End(Not run)
Run the code above in your browser using DataLab