/// <exception cref="System.SqlSyntaxErrorException" /> public static void Main(string[] args) { var sql = Performance.SqlBenchmarkSelect; var chars = sql.ToCharArray(); var sut = new MySqlLexer(sql); var start = Runtime.CurrentTimeMillis(); var end = Runtime.CurrentTimeMillis(); for (var i = 0; i < 1; ++i) { for (; !sut.Eof();) { sut.NextToken(); switch (sut.Token()) { case MySqlToken.LiteralNumMixDigit: { sut.GetDecimalValue(); break; } case MySqlToken.LiteralNumPureDigit: { sut.GetIntegerValue(); break; } default: { sut.GetStringValue(); break; } } } } var loop = 5000000; sut = new MySqlLexer(sql); start = Runtime.CurrentTimeMillis(); for (var i_1 = 0; i_1 < loop; ++i_1) { sut = new MySqlLexer(chars); for (; !sut.Eof();) { sut.NextToken(); switch (sut.Token()) { case MySqlToken.LiteralNumMixDigit: { sut.GetDecimalValue(); break; } case MySqlToken.LiteralNumPureDigit: { sut.GetIntegerValue(); break; } default: { sut.GetStringValue(); break; } } } } end = Runtime.CurrentTimeMillis(); Console.Out.WriteLine((end - start)*1.0d/(loop/1000) + " us."); }