Example #1
0
        public static Task <TimedResult <TNewResult> > ContinueWithTimed <TResult, TNewResult>(this Task <TResult> task,
                                                                                               Func <Task <TResult>, TNewResult> supplier)
        {
            var timed = TimedResult.Of(() => supplier(task));

            return(task.ContinueWith(t => timed()));
        }
Example #2
0
        public static Task <TimedResult <T> > StartNewTimed <T>(this TaskFactory factory, Func <T> supplier)
        {
            var timed = TimedResult.Of(supplier);

            return(factory.StartNew(timed));
        }