I have a small program that does some downloads. Some of those take a fair amount of time, but the download itself may not be the issue. The design looks like this:

Code:
Sub Main()
        
        Dim tskLst As New List(Of Task)
       
        LogInfoToDB("General", "All process began.", "", False)

        tskLst.Add(ProcA)
        tskLst.Add(ProcB)
        tskLst.Add(ProcC)
       
        Task.WaitAll(tskLst.ToArray)

        LogInfoToDB("General", "All process completed.", "", False)
       
End Sub

Public Async Function ProcA() As Task(Of Boolean)
   LogInfoToDB("ProcA", "process A began.", "", False)
   
   'Do the download and do something with the data.

   LogInfoToDB("ProcA", "process A completed.", "", False)
End Function

Public Async Function ProcB() As Task(Of Boolean)
    LogInfoToDB("ProcB", "process B began.", "", False)
   
   'Do the download and do something with the data.

   LogInfoToDB("ProcB", "process B completed.", "", False) 
End Function

Public Async Function ProcC() As Task(Of Boolean)
    LogInfoToDB("ProcC", "process C began.", "", False)
   
   'Do the download and do something with the data.

   LogInfoToDB("ProcC", "process C completed.", "", False)
End Function
The names have been changed for simplicity. Each Proc does virtually the same thing. It attempts a download where the only difference between the three is a part of the URL.

As it turns out, Proc C is super fast, Proc A is quite slow, and Proc B is intermediate in speed. By quite slow, though, I mean that Proc A is taking a couple seconds, while Proc C is taking a few milliseconds.

The logging included writing the current time to a DB record along with a message, as shown. Because of that logging, I could tell when each process began and ended.

As it turned out, Proc B was failing with a semi-cryptic error about a thread being canceled. I wasn't doing that, but a bit of research suggested that a timeout was a big cause of that exception, and that was possible. Therefore, I decided to just cause Proc B to delay a little while before starting, so that it would happen only after the other two had finished. To do this, I made this change:
Code:
Public Async Function ProcB() As Task(Of Boolean)

    Await Task.Delay(60000)
    LogInfoToDB("ProcB", "process B began.", "", False)
   
   'Do the download and do something with the data.

   LogInfoToDB("ProcB", "process B completed.", "", False) 
End Function
What I thought that would do would be to pause ProcB for 10 minutes. Based on the logging, what it actually did was quite a bit different from that. For one thing, the log record "process B began." was written to the database exactly as it always had been. In other words, that line didn't delay the start in any way. I thought that's what it was supposed to do based on some example I had read. Perhaps I misunderstood. Can somebody explain to me what Await Task.Delay() actually does in this example? It certainly doesn't pause the current thread in any noticeable way.

The second thing it might have done is harder to explain. The download neither appeared to succeed nor fail. No further messages were logged from that thread, and the function ProcB never returned, so the WaitAll in Sub Main...may still be waiting, for all I know.

I believe this was working when I used Thread.Sleep rather than Await Task.Delay(), I just thought that the latter was the more appropriate thing to do. Apparently, I was wrong about that. What does it do?