pi_seq
: Implements uses sequential calculationspi_con
: Implements uses concurrency
-
Compile:
c(pi_seq). c(pi_con).
-
Run and compare elapsed time:
pi_seq:run(23000000, 30).
Pi: 3.1411624721233706 Elapsed time: 65.489 seconds
pi_con:run(23000000, 30).
Pi: 3.1411339503854805 Elapsed time: 19.501 seconds