We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f489891 commit acaff80Copy full SHA for acaff80
makefile
@@ -3,6 +3,10 @@
3
test-php:
4
./dist/bin/php test-ffi.php
5
6
+# 测试python下fib
7
+test-python:
8
+ python test-fib.py
9
+
10
# 测试字符串调用
11
test-php2:
12
./dist/bin/php test-ffi2.php
test-fib.py
@@ -0,0 +1,16 @@
1
+#!/usr/bin/python
2
+# -*- coding: UTF-8 -*-
+import time
+def fib(n):
+ if n <= 2:
+ return 1
+ else:
+ return fib(n - 1) + fib(n - 2)
+start_time = time.time()
+for x in xrange(1,1000000):
13
+ v = fib(12)
14
+print("[Python]执行时间:%s" % (time.time() - start_time))
15
16
+# [Python]执行时间:56.9069800377
0 commit comments