> About edit: i experimented with for loops. We measure time for running
> without threading and with that. Just for that cause i used CpuTime() :)
If you have 8 threads and each spend a second to do something, the CPU time is
8s. What you're interested in is the wall time / elapsed time, use
`
About edit: i experimented with for loops. We measure time for running without
threading and with that. Just for that cause i used CpuTime() :)
FML. You absolutely right about type in Thread. Big tnx! I skipped it for my
example xd
Hello Ivan! Your number: 0
Hello Maxim! Your number: 1
Hello Maikl! Your number: 2
Hello Alex! Your number: 3
1.267
Run
Well the error message is complaining that you're trying to run a `Thread[int]`
with a `proc (_: Student)` and a value of type `Student`. The generic type of
the thread needs to match the argument.
Apart from that I believe the `threads` variable has to be global.
Hello! I have this experimental code:
import strformat
import os
import times
type
Student* = object
name: string
num: int
proc sayHi(student: Student) {.thread, nimcall.} =
echo fmt"Hello {student.name}! Your