1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
| const Benchmark = require('benchmark');
const suite = new Benchmark.Suite();
suite
.add('OpenClaw#simpleQuery', async () => {
await openclaw.ask('你好');
})
.add('OpenClaw#complexQuery', async () => {
await openclaw.ask('写一个快速排序算法');
})
.on('complete', function() {
console.log('最快: ' + this.filter('fastest').map('name'));
})
.run();
|