summaryrefslogtreecommitdiff
path: root/doc/context/sources/general/manuals/hybrid/benchmark-5.tex
blob: 49fae5da3d1281219f0ab7e26d7faa950ef3d886 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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