function createTable(suite) {
    return function (tagName, id, className) {
      // Create the table.
      var table = createElement({
        tagName:   tagName,
        id:        id,
        className: className
      });
      // Create the table head.
      var head = createElement({
        tagName:  'thead',
        children: [{
          tagName:  'tr',
          children: [{
            tagName:   'th'
          }, {
            tagName:   'th',
            scope:     'col',
            innerHTML: i18n.table.test
          }, {
            tagName:   'th',
            scope:     'col',
            innerHTML: i18n.table.hz
          }]
        }]
      });
      // Create the table body.
      var body = createElement({
        tagName: 'tbody'
      });

      // Append each bench to the table body.
      suite.forEach(function (bench) {
        var name = bench.name;
        var fn   = bench.fn.toString();
        var hz   = bench.hz;
        var rme  = bench.stats.rme;

        // Create an element for the bench...
        var row = createElement({
          tagName:  'tr',
          children: [{
            tagName:   'th',
            scope:     'row',
            innerHTML: name
          }, {
            tagName:  'td',
            children: [{
              tagName:   'pre',
              className: 'prettyprint',
              children:  [{
                tagName:   'code',
                className: 'language-javascript',
                textContent: fn
              }]
            }]
          }, {
            tagName:   'td',
            id:        formatString('benchmark_{0}_{1}', suite.id, bench.id),
            className: 'benchmark',
            innerHTML: i18n.status.ready
          }]
        });
        // ... and append it to the table body.
        body.appendChild(row);
      });

      // Compose the table.
      table.appendChild(head);
      table.appendChild(body);

      return table;
    };
  }
// Creates a table for the suite.
Creates a table for the suite.
Creates a table for the suite .
function createTable(suite) {
    return function (tagName, id, className) {
      var table = createElement({
        tagName:   tagName,
        id:        id,
        className: className
      });
      var head = createElement({
        tagName:  'thead',
        children: [{
          tagName:  'tr',
          children: [{
            tagName:   'th'
          }, {
            tagName:   'th',
            scope:     'col',
            innerHTML: i18n.table.test
          }, {
            tagName:   'th',
            scope:     'col',
            innerHTML: i18n.table.hz
          }]
        }]
      });
      var body = createElement({
        tagName: 'tbody'
      });
      suite.forEach(function (bench) {
        var name = bench.name;
        var fn   = bench.fn.toString();
        var hz   = bench.hz;
        var rme  = bench.stats.rme;
        var row = createElement({
          tagName:  'tr',
          children: [{
            tagName:   'th',
            scope:     'row',
            innerHTML: name
          }, {
            tagName:  'td',
            children: [{
              tagName:   'pre',
              className: 'prettyprint',
              children:  [{
                tagName:   'code',
                className: 'language-javascript',
                textContent: fn
              }]
            }]
          }, {
            tagName:   'td',
            id:        formatString('benchmark_{0}_{1}', suite.id, bench.id),
            className: 'benchmark',
            innerHTML: i18n.status.ready
          }]
        });
        body.appendChild(row);
      });
      table.appendChild(head);
      table.appendChild(body);
      return table;
    };
  }
function createTable ( suite ) { return function ( tagName , id , className ) { var table = createElement ( { tagName : tagName , id : id , className : className } ) ; var head = createElement ( { tagName : 'thead' , children : [ { tagName : 'tr' , children : [ { tagName : 'th' } , { tagName : 'th' , scope : 'col' , innerHTML : i18n . table . test } , { tagName : 'th' , scope : 'col' , innerHTML : i18n . table . hz } ] } ] } ) ; var body = createElement ( { tagName : 'tbody' } ) ; suite . forEach ( function ( bench ) { var name = bench . name ; var fn = bench . fn . toString ( ) ; var hz = bench . hz ; var rme = bench . stats . rme ; var row = createElement ( { tagName : 'tr' , children : [ { tagName : 'th' , scope : 'row' , innerHTML : name } , { tagName : 'td' , children : [ { tagName : 'pre' , className : 'prettyprint' , children : [ { tagName : 'code' , className : 'language-javascript' , textContent : fn } ] } ] } , { tagName : 'td' , id : formatString ( 'benchmark_{0}_{1}' , suite . id , bench . id ) , className : 'benchmark' , innerHTML : i18n . status . ready } ] } ) ; body . appendChild ( row ) ; } ) ; table . appendChild ( head ) ; table . appendChild ( body ) ; return table ; } ; }
Creates a table for the suite.
Creates a table for the suite .
// Create the table. // Create the table head. // Create the table body. // Append each bench to the table body. // Create an element for the bench... // ... and append it to the table body. // Compose the table.