Skip to content

Commit 2581595

Browse files
committed
use Matter.Runner in test worker
1 parent a30707f commit 2581595

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test/ExampleWorker.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ const runExample = options => {
1212

1313
const Examples = requireUncached('../examples/index');
1414
const example = Examples[options.name]();
15+
1516
const engine = example.engine;
17+
const runner = example.runner;
18+
19+
runner.delta = 1000 / 60;
20+
runner.isFixed = true;
1621

1722
let totalMemory = 0;
1823
let totalDuration = 0;
@@ -24,8 +29,8 @@ const runExample = options => {
2429
for (let i = 0; i < options.updates; i += 1) {
2530
const startTime = process.hrtime();
2631
totalMemory += process.memoryUsage().heapUsed;
27-
28-
Matter.Engine.update(engine, 1000 / 60);
32+
33+
Matter.Runner.tick(runner, engine, i * runner.delta);
2934

3035
const duration = process.hrtime(startTime);
3136
totalDuration += duration[0] * 1e9 + duration[1];

0 commit comments

Comments
 (0)