async Task FetchBatchResults(int num) { var batch = new MLArrayBatchProvider(inputs.Take(num).ToArray()); var options = new MLPredictionOptions() { UsesCpuOnly = false }; Stopwatch stopWatch = Stopwatch.StartNew(); await Task.Run(() => { model.GetPredictions(batch, options, out NSError error); }); stopWatch.Stop(); batchMilliseconds = stopWatch.ElapsedMilliseconds; }