summaryrefslogtreecommitdiff
path: root/doc/context/sources/general/manuals/hybrid/benchmark-5.tex
diff options
context:
space:
mode:
Diffstat (limited to 'doc/context/sources/general/manuals/hybrid/benchmark-5.tex')
-rw-r--r--doc/context/sources/general/manuals/hybrid/benchmark-5.tex29
1 files changed, 29 insertions, 0 deletions
diff --git a/doc/context/sources/general/manuals/hybrid/benchmark-5.tex b/doc/context/sources/general/manuals/hybrid/benchmark-5.tex
new file mode 100644
index 000000000..49fae5da3
--- /dev/null
+++ b/doc/context/sources/general/manuals/hybrid/benchmark-5.tex
@@ -0,0 +1,29 @@
+\starttext
+
+\startluacode
+
+ if jit then
+ jit.on()
+ jit.off()
+ end
+
+ local t = os.clock()
+ local a = 0
+ for i=1,10*1000*1000 do
+ a = a + math.sin(i)
+ end
+ context(os.clock()-t)
+
+ context.par()
+
+ local t = os.clock()
+ local sin = math.sin
+ local a = 0
+ for i=1,10*1000*1000 do
+ a = a + sin(i)
+ end
+ context(os.clock()-t)
+
+\stopluacode
+
+\stoptext