php-sqlsrv/test/Performance/benchmark/pdo_sqlsrv/PDOSelectVersionBench.php

31 lines
570 B
PHP
Raw Normal View History

2017-05-06 02:32:09 +02:00
<?php
use PDOSqlsrvPerfTest\PDOSqlsrvUtil;
/**
* @Iterations(10000)
2017-05-06 02:32:09 +02:00
* @BeforeMethods({"connect"})
* @AfterMethods({"disconnect"})
*/
2017-08-23 01:15:33 +02:00
class PDOSelectVersionBench
{
2017-05-06 02:32:09 +02:00
private $conn;
2017-08-23 01:15:33 +02:00
public function connect()
{
2017-05-06 02:32:09 +02:00
$this->conn = PDOSqlsrvUtil::connect();
}
/*
* Each iteration calls execDirect API to fetch @@Version
*/
2017-08-23 01:15:33 +02:00
public function benchSelectVersion()
{
$version = PDOSqlsrvUtil::selectVersion( $this->conn );
2017-05-06 02:32:09 +02:00
}
2017-08-23 01:15:33 +02:00
public function disconnect()
{
2017-05-06 02:32:09 +02:00
PDOSqlsrvUtil::disconnect( $this->conn );
}
}