mirror of
https://github.com/Open-Argon/argon-v3.git
synced 2025-12-06 08:56:07 +00:00
add eval and potentially speed up variable access speeds when multi threading. fix bug in threading count
This commit is contained in:
14
tests/multi_threading.ar
Normal file
14
tests/multi_threading.ar
Normal file
@@ -0,0 +1,14 @@
|
||||
let mythread(threadID) = do
|
||||
term.log(threadID, "start")
|
||||
let mynumber = 10
|
||||
for (i from 0 to 1e4) do
|
||||
mynumber += 1
|
||||
mynumber
|
||||
return term.log(threadID, "done")
|
||||
|
||||
let threads = []
|
||||
term.time("start")
|
||||
for (i from 0 to 100) do
|
||||
threads.append(thread(()=mythread(i)))
|
||||
threads[i].start()
|
||||
term.timeEnd("start")
|
||||
Reference in New Issue
Block a user