php-sqlsrv/test/Performance/benchmark/sqlsrv/SqlsrvSelectVersionBench.php

31 lines
561 B
PHP
Raw Normal View History

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