Esempio n. 1
0
 private Task <long> RunOneQuery()
 {
     return(SwTimer.Time(
                () => Task.Run(
                    () => provider.Count
                    )
                ));
 }
Esempio n. 2
0
        private async void button1_Click(object sender, EventArgs e)
        {
            var duration = await SwTimer.Time(async() =>
                                              await Task.Run(
                                                  () => provider.ReadAllFiles().Wait()
                                                  ));

            var message = $"ReadAllFiles duration: {duration}ms";
        }