File: vml_timing3.py

package info (click to toggle)
numexpr 2.14.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 784 kB
  • sloc: cpp: 4,250; python: 3,985; ansic: 369; makefile: 203
file content (15 lines) | stat: -rw-r--r-- 313 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# -*- coding: utf-8 -*-
from timeit import default_timer as timer

import numpy as np

import numexpr as ne

x = np.ones(100000)
scaler = -1J
start = timer()
for k in range(10000):
    cexp = ne.evaluate('exp(scaler * x)')
exec_time=(timer() - start)

print("Execution took", str(round(exec_time, 3)), "seconds")