call function+55465

Benchmark created by for vs while on


Description

how much time it takes to call an empty function.

Setup

function push(num,digit,base){
        if(0<=digit)
                if(digit<base)
                        return num*base+digit;
                else
                        throw ('Invalid base!')
        else
                throw ('Invalid digit!');
    }
    
    
    function pop(num,base){
        var newnum=Math.floor(num/base);
        var diff=num%base;
        
    return [newnum,diff];
    }
    
    function test1(num,digit,base){
    num=num*base+digit;
    return [Math.floor(num/base),num%base];
    }
    function test2(num,digit,base){
    num=push(num,digit,base)
    return pop(num,base);
    }
    
    var num=0;
    var digit=1;
    var base=2;

Test runner

Ready to run.

Testing in
TestOps/sec
empty function normal
test1(num,digit,base);
ready
empty function in empty function
test2(num,digit,base);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.

  • Revision 1: published by for vs while on