Esempio n. 1
0
 // Make a list of size _count for a benchmark. The listmaking time is excluded from the total time.
 private List MakeList <List>(List list, Benchmarker b, bool new_r = true) where List : ICollection <long>
 {
     b.PauseTimer();
     list = AddAtEnd(list, _count);
     if (new_r)
     {
         _r = new Random(_seed);
     }
     b.ResumeTimer();
     return(list);
 }
Esempio n. 2
0
 // Make a list of size _count for a benchmark. The listmaking time is excluded from the total time.
 private List MakeList <List>(List list, Benchmarker b, bool new_r = true) where List : IList <long>
 {
     b.PauseTimer();
     for (int i = 0; i < _count; i++)
     {
         list.Add(i);
     }
     if (new_r)
     {
         _r = new Random(_seed);
     }
     b.ResumeTimer();
     return(list);
 }
Esempio n. 3
0
        // Make a dictionary of size _count for a benchmark. Time used is excluded from the total time.
        private Dict MakeDict <Dict>(Dict list, Benchmarker b, out int max, bool new_r = true) where Dict : IDictionary <long, int>
        {
            b.PauseTimer();
            if (new_r)
            {
                _r = new Random(_seed);
            }
            int k = 0;

            for (int i = 0; i < _count; i++)
            {
                list.Add(k, i);
                k += _r.Next(50, 150);
            }
            b.ResumeTimer();
            max = k;
            return(list);
        }