Exemplo n.º 1
0
        private void MakeComplicatedWork(Action <byte[]> action, byte[] bytes)
        {
            DoingWork = true;
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();
            action(bytes);
            stopwatch.Stop();
            NotifyPopup.ShowToast("用时" + (int)stopwatch.Elapsed.TotalSeconds + "." + stopwatch.Elapsed.Milliseconds + "秒");
            DoingWork = false;
        }
Exemplo n.º 2
0
        private async Task MakeComplicatedWork(Func <Task> action)
        {
            DoingWork = true;
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();
            await action();

            stopwatch.Stop();
            NotifyPopup.ShowToast("用时" + (int)stopwatch.Elapsed.TotalSeconds + "." + stopwatch.Elapsed.Milliseconds + "秒");
            DoingWork = false;
        }