コード例 #1
0
ファイル: VectorizerTest.cs プロジェクト: ubhatwar/vectorizer
 public void ScoreDrawMethods()
 {
     foreach (var drawer in drawers)
     {
         var total = TimeSpan.Zero;
         foreach (var polygon in ListUtil.Repeat(() => testPolygons, 10).SelectMany(x => x))
         {
             var first = DateTime.Now;
             drawer.Draw(polygon).ToList();
             var then = DateTime.Now;
             total += then - first;
         }
         Console.WriteLine("drawer " + drawer + " took " + total.TotalMilliseconds + " ms.");
     }
 }
コード例 #2
0
 public static IEnumerable <T> ApplySlow <T>(Random random, IList <T> xs)
 {
     return(ListUtil.Repeat(() => (int)(xs.Count * Sample(random))).Distinct().Take(xs.Count).Select(index => xs[index]));
 }