private static void TestGenerationAsSecure(ReadablePassphraseGenerator generator, IEnumerable <PhraseStrength> strengths, int iterations)
 {
     Console.Write("Testing {0:N0} secure phrases of strength {1}...", iterations, String.Join(",", strengths.Select(x => x.ToString())));
     for (int i = 0; i < iterations; i++)
     {
         generator.GenerateAsSecure(strengths);
     }
     Console.WriteLine(" OK.");
 }
 private static void TestGenerationAsSecure(ReadablePassphraseGenerator generator, PhraseStrength strength, int iterations)
 {
     Console.Write("Testing {0:N0} secure phrases of strength {1}...", iterations, strength);
     for (int i = 0; i < iterations; i++)
     {
         generator.GenerateAsSecure(strength);
     }
     Console.WriteLine(" OK.");
 }
        private static void BenchmarkSecureGeneration(ReadablePassphraseGenerator generator, PhraseStrength strength, int iterations)
        {
            Console.WriteLine();
            Console.WriteLine("Benchmark of {0:N0} secure phrases of strength {1}...", iterations, strength);
            var sw = System.Diagnostics.Stopwatch.StartNew();

            for (int i = 0; i < iterations; i++)
            {
                generator.GenerateAsSecure(strength);
            }
            sw.Stop();
            Console.WriteLine("  in {0:N3}ms", sw.Elapsed.TotalMilliseconds);
        }