In the previous examples, we used the async method to execute the code blocks. When we use the async method, the call will not block the current thread. This means that the method returns and the code block is executed asynchronously.
Rather than using the async method, we could use the sync method to execute the code blocks. The sync method will block the current thread, which means it will not return until the execution of the code has completed. Generally, we use the async method, but there are use cases where the sync method is useful. This use case is usually when we have a separate thread and we want that thread to wait for some work to finish.