Exemplo n.º 1
0
 internal static void Visualize <TSource>(
     this ParallelQuery <TSource> source, Action <TSource> action, string span = Parallel, int category = 1)
 {
     using (Markers.EnterSpan(category, span))
     {
         MarkerSeries markerSeries = Markers.CreateMarkerSeries(span);
         source.ForAll(value =>
         {
             using (markerSeries.EnterSpan(Thread.CurrentThread.ManagedThreadId, value.ToString()))
             {
                 action(value);
             }
         });
     }
 }
Exemplo n.º 2
0
 internal static void Visualize <TSource>(
     this IEnumerable <TSource> source, Action <TSource> action, string span = Sequential, int category = 0)
 {
     using (Markers.EnterSpan(category, span))
     {
         MarkerSeries markerSeries = Markers.CreateMarkerSeries(span);
         source.ForEach(value =>
         {
             using (markerSeries.EnterSpan(Thread.CurrentThread.ManagedThreadId, value.ToString()))
             {
                 action(value);
             }
         });
     }
 }