1
// Copyright (C) 2004-2007 MySQL AB
3
// This program is free software; you can redistribute it and/or modify
4
// it under the terms of the GNU General Public License version 2 as published by
5
// the Free Software Foundation
7
// There are special exceptions to the terms and conditions of the GPL
8
// as it is applied to this software. View the full text of the
9
// exception in file EXCEPTIONS in the directory of this software
12
// This program is distributed in the hope that it will be useful,
13
// but WITHOUT ANY WARRANTY; without even the implied warranty of
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
// GNU General Public License for more details.
17
// You should have received a copy of the GNU General Public License
18
// along with this program; if not, write to the Free Software
19
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
using MySql.Data.MySqlClient;
24
using NUnit.Framework;
26
namespace MySql.Data.MySqlClient.Tests
29
public class MicroPerfTests : BaseTest
31
protected override void Setup()
34
execSQL("DROP TABLE IF EXISTS Test");
35
execSQL("CREATE TABLE Test (id int NOT NULL, name VARCHAR(100))");
39
public void Connect1000Times()
41
DateTime start = DateTime.Now;
43
for (int i = 0; i < 1000; i++)
45
MySqlConnection c = new MySqlConnection(
46
base.GetConnectionString(true));