mirror of
https://github.com/logos-storage/apatheia.git
synced 2026-01-04 05:53:11 +00:00
got together
This commit is contained in:
parent
bcaeda748f
commit
e86a7f6727
@ -11,14 +11,13 @@ import apatheia/tasks
|
|||||||
## todo: setup basic async + threadsignal + taskpools example here
|
## todo: setup basic async + threadsignal + taskpools example here
|
||||||
##
|
##
|
||||||
|
|
||||||
|
|
||||||
proc addNums(a, b: float): float {.asyncTask.} =
|
proc addNums(a, b: float): float {.asyncTask.} =
|
||||||
os.sleep(500)
|
os.sleep(100)
|
||||||
echo "adding: ", a, " + ", b
|
echo "adding: ", a, " + ", b
|
||||||
return a + b
|
return a + b
|
||||||
|
|
||||||
proc addNumValues(vals: openArray[float]): float {.asyncTask.} =
|
proc addNumValues(vals: openArray[float]): float {.asyncTask.} =
|
||||||
os.sleep(500)
|
os.sleep(100)
|
||||||
result = 0.0
|
result = 0.0
|
||||||
for x in vals:
|
for x in vals:
|
||||||
result += x
|
result += x
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user