TaskFactory<TResult>.StartNew Method (Func<TResult>, TaskCreationOptions)
Creates and starts a task.
Assembly: mscorlib (in mscorlib.dll)
public Task<TResult> StartNew( Func<TResult> function, TaskCreationOptions creationOptions )
- Type: System.Func<TResult>
A function delegate that returns the future result to be available through the task.
- Type: System.Threading.Tasks.TaskCreationOptions
One of the enumeration values that controls the behavior of the created task.
However, unless creation and scheduling must be separated, StartNew is the recommended approach for both simplicity and performance.