Open danbst opened 5 years ago
Hi @danbst,
The behavior is correct. Unfortunately, the example/explanation is mostly incomplete.
To get the expected behavior, you need to split the emit 1s
, into multiple emit 100ms
.
Since the examples are running on the server in "simulation mode", all input is artificial and has no relation with the real world.
If your program says emit 1s
, Céu will just assume that happened and simulate that 1s
elapsed, so it will not have time to advance the async
trail.
When you split the simulation into multiple steps of 100ms
, each time Céu will also advance the async
trail.
(As an alternative, you could also use an async/thread
trail to get real parallelism, but it's not supported in the online tutorial.)
Let me know if you have further question.
Regards, Francisco
Oh, ok. Then I propose to change that example, so there are 10 emit 1s;
in "input", and await 10s
in code. So, reducing factorial number would actually work.
Sure! Thanks for the feedback!
I've modified code (copying here original one)
and set
var int i = 1;
. I expected factorial of 1 to be computed faster than 1s, but surprisingly result was 0.How can this be explained?