Skip to content

Commit 1d9d23d

Browse files
committed
add a small python script to show native profiling
1 parent 6553bb9 commit 1d9d23d

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

vmprof/test/sqlite.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import sqlite3
2+
import math
3+
from os import unlink
4+
from os.path import exists
5+
6+
7+
def main():
8+
if exists('test.db'):
9+
unlink('test.db')
10+
conn = sqlite3.connect('test.db')
11+
12+
c = conn.cursor()
13+
c.execute("""
14+
CREATE TABLE stocks
15+
(date text, trans text, symbol text, qty real, price real)
16+
""")
17+
for i in range(10000):
18+
c.execute("""
19+
INSERT INTO stocks VALUES ('{}','{}','{}', {}, {})
20+
""".format('2011-01-05', 'BUY', 'ABC', i, math.sqrt(i)))
21+
22+
23+
main()

0 commit comments

Comments
 (0)