Skip to main content
D G's user avatar
D G's user avatar
D G's user avatar
D G
  • Member for 2 years, 8 months
  • Last seen more than a week ago
  • Jail
About
static async Task Main()
{
    var f = async (char c) =>
    {
        for (int i = 0; i < 5; ++i)
        {
            Console.WriteLine(c);
            await Task.Yield();
        }
    };

    Console.WriteLine("Begin");
    var a = f('*');
    var b = f('-');
    await Task.WhenAll(a, b);
    Console.WriteLine("End");
}

and

async function Main() {
    let f = async (c) => {
        for (let i = 0; i < 5; ++i) {
            console.log(c)
            await Promise.resolve();
        }
    }
    console.log('Begin');
    const a = f('*');
    const b = f('-');
    await Promise.all([a, b]);
    console.log('End');
}
Badges
This user doesn’t have any gold badges yet.
This user doesn’t have any silver badges yet.
4
bronze badges
Top tags
0
Score
1
Posts
50
Posts %
0
Score
1
Posts
50
Posts %
0
Score
1
Posts
50
Posts %
0
Score
1
Posts
50
Posts %
0
Score
1
Posts
50
Posts %
Top posts