Самке
Updating progress on the screen problem
To be honest this is just an exercise so it is not something important to me 😁 but still it was odd to see result in a wrong order. I think i will stick with Task.Delay for now and i will do a little bit of research on event queue and callback async
19 replies
Updating progress on the screen problem
Result:
Press C to exit
Enter the number:
15
index: 2 progress: 3
index: 1 progress: 1
index: 5 progress: 15
index: 3 progress: 6
index: 4 progress: 10
index: 10 progress: 55
index: 6 progress: 21
index: 8 progress: 36
index: 7 progress: 28
index: 15 progress: 120
index: 13 progress: 91
index: 12 progress: 78
index: 9 progress: 45
index: 11 progress: 66
index: 14 progress: 105
Final result: 120
19 replies
Updating progress on the screen problem
And if i add the Task.Delay(1).Wait(); in my Calc task then i will get the correct output
Result after modification:
Press C to exit
Enter the number:
15
index: 1 progress: 1
index: 2 progress: 3
index: 3 progress: 6
index: 4 progress: 10
index: 5 progress: 15
index: 6 progress: 21
index: 7 progress: 28
index: 8 progress: 36
index: 9 progress: 45
index: 10 progress: 55
index: 11 progress: 66
index: 12 progress: 78
index: 13 progress: 91
index: 14 progress: 105
index: 15 progress: 120
Final result: 120
19 replies