Skip to content

Commit 44d1183

Browse files
committed
time -> %time
1 parent f96df16 commit 44d1183

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

demo-cython.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Here is a function that computes `\sum_{k=0}^N k` in pure Python::
1111
....: for k in range(1,N):
1212
....: s += k
1313
....: return s
14-
sage: time mysum(10^7)
14+
sage: %time mysum(10^7)
1515

1616
Let us compare this with the Cython version::
1717

@@ -25,7 +25,7 @@ Let us compare this with the Cython version::
2525

2626
::
2727

28-
sage: time mysum_cython(10^7)
28+
sage: %time mysum_cython(10^7)
2929

3030

3131
A function to count the number of integer partitions with parts in a
@@ -53,7 +53,7 @@ given set::
5353
Let us see how long it takes to find the number of partitions of 500
5454
into odd parts::
5555

56-
sage: time buying([1,3..500], 500)
56+
sage: %time buying([1,3..500], 500)
5757
732986521245024
5858
Time: CPU 3.05 s, Wall: 3.05 s
5959

@@ -77,7 +77,7 @@ Make two changes::
7777

7878
Surely two tiny changes in some Python code cannot make it much faster::
7979

80-
sage: time cybuying([1,3..500], 500)
80+
sage: %time cybuying([1,3..500], 500)
8181
732986521245024L
8282
Time: CPU 0.08 s, Wall: 0.09 s
8383

0 commit comments

Comments
 (0)