当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Suite.run方法代码示例

本文整理汇总了TypeScript中benchmark.Suite.run方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Suite.run方法的具体用法?TypeScript Suite.run怎么用?TypeScript Suite.run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在benchmark.Suite的用法示例。


在下文中一共展示了Suite.run方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: function

    suite.add(`local runtime-html BasicConfiguration`, function() {
      local.kernel.DI.createContainer().register(local.runtimeHtml.BasicConfiguration);
    });
    suite.add(`local jit-html     BasicConfiguration`, function() {
      local.kernel.DI.createContainer().register(local.jitHtml.BasicConfiguration);
    });

    suite.add(`  dev runtime-html BasicConfiguration`, function() {
      dev.kernel.DI.createContainer().register(dev.runtimeHtml.HTMLRuntimeConfiguration);
    });
    suite.add(`  dev jit-html     BasicConfiguration`, function() {
      dev.kernel.DI.createContainer().register(dev.jitHtml.HTMLJitConfiguration);
    });

    suite.run();
  },
  ['resolve']() {
    const count = parseInt(rest[0], 10);
    class LocalSingleton {
      static register(container) {
        return local.kernel.Registration.singleton(LocalSingleton, this).register(container);
      }
    }
    class LocalTransient {
      static register(container) {
        return local.kernel.Registration.transient(LocalTransient, this).register(container);
      }
    }
    class DevSingleton {
      static register(container) {
开发者ID:aurelia,项目名称:aurelia,代码行数:30,代码来源:container.ts

示例2: PrioritizedHandlers

      const eventTypes = global.require('../event-system/eventTypes').default;
      const eventPriorities = global.require('../event-system/eventTypes').eventPriorities;
      const Handler = global.require('../event-system/Handler').default;
      const prioritizedHandlers = new PrioritizedHandlers();
    }
  })
  // add listeners
  .on('cycle', function (event) {
    console.log(String(event.target), event.target.error || '');
  })
  .on('complete', function () {
    // console.dir(this)
    console.log('Fastest is ' + this.filter('fastest').map('name'));
  });

suite.run({ 'async': true });


//
// .add('SubscribedHandlers#remove 1 of 11', function () {
//   subscribedHandlers.add(subscription);
//   subscribedHandlers.remove(subscription);
// }, {
//   setup: function () {
//     const SubscribedHandlers = global.require('../SubscribedHandlers').default;
//     const subscribedHandlers = new SubscribedHandlers();
//     let j = 0;
//
//     function addEvents() {
//       for (var i = 0; i < 5; i++)
//         subscribedHandlers.add({ eventName: 'event' + i, component: { id: 0 }, priority: j++ });
开发者ID:nathantreid,项目名称:shattered-planes,代码行数:31,代码来源:SubscribedHandlers.add.ts

示例3:

        const array = new ObservableArray<number>([]);
        const even = array.map(x => x % 2 === 0);
        for (let i = 0; i < 100; i++) {
            array.push(i);
        }
    })
    .add("ComputedArray#some", () => {
        const array = new ObservableArray<number>([]);
        const even = array.some(x => x % 2 === 0);
        for (let i = 0; i < 100; i++) {
            array.push(i);
        }
    })
    .add("ComputedArray#every", () => {
        const array = new ObservableArray<number>([]);
        const even = array.every(x => x % 2 === 0);
        for (let i = 0; i < 100; i++) {
            array.push(i);
        }
    })
    .add("ComputedArray#reduce", () => {
        const array = new ObservableArray<number>([]);
        const max = array.reduce((x, y) => x > y ? x : y, 0);
        for (let i = 0; i < 100; i++) {
            array.push(i);
        }
    });

suite.run({ async: true });
export default suite;
开发者ID:milutinovici,项目名称:proactive,代码行数:30,代码来源:test.ts


注:本文中的benchmark.Suite.run方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。