File: select_1000_rows.py

package info (click to toggle)
mariadb-connector-python 1.1.13-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 812 kB
  • sloc: python: 6,246; ansic: 4,971; sh: 23; makefile: 14
file content (15 lines) | stat: -rw-r--r-- 419 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env python3 -O
# -*- coding: utf-8 -*-

import pyperf


def select_1000_rows(loops, conn, paramstyle):
    range_it = range(loops)
    t0 = pyperf.perf_counter()
    for value in range_it:
        cursor = conn.cursor()
        cursor.execute("select seq, 'abcdefghijabcdefghijabcdefghijaa' from seq_1_to_1000")
        rows = cursor.fetchall()
        del cursor, rows
    return pyperf.perf_counter() - t0