예제 #1
0
        async Task <PollingReturn <string, Exception> > IMeasure <int, string, Exception> .measure(IPoll <int, string> polling,
                                                                                                   int input)
        {
            var timer = new Stopwatch();

            timer.Start();
            var ret         = new PollingReturn <string, Exception>();
            var pollingTask = polling.poll(input);

            try
            {
                ret.output  = await pollingTask;
                ret.success = true;
            }
            catch (Exception exc)
            {
                ret.error = exc;
            }
            timer.Stop();
            ret.elapsed = timer.Elapsed;
            return(ret);
        }