File: encode.py

package info (click to toggle)
haskell-aeson 0.6.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 616 kB
  • sloc: haskell: 2,447; python: 67; makefile: 15
file content (14 lines) | stat: -rwxr-xr-x 270 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env python

import json, sys, time

count = int(sys.argv[1])

for n in sys.argv[2:]:
    print '%s:' % n
    obj = json.load(open(n))
    start = time.time()
    for i in xrange(count):
        json.dumps(obj)
    end = time.time()
    print ' ', end - start