I'll be referring to this answer by Stephen Cleary from another post.
I'm trying to implement something similar, but I am fairly new to C#.
My question is: The await
is applied to ReadAsync
, and if ReadAsync
has not completed then it returns from the ReadAllFileAsync
method to Main
, and then, what happens? Does Main
continues running?
The reason for my question is that I want to know how the stopwatch elapsed time would not be affected by this.
If the important work is reading the file (since we're timing it), and there's no UI at risk of being blocked, why use async
/await
?