Skip to content

Commit 5efa04f

Browse files
author
Guy Bedford
committed
feat: support fastly:runtime#vCpuTime function
1 parent beda622 commit 5efa04f

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

integration-tests/js-compute/fixtures/app/src/runtime.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@ import { vCpuTime } from "fastly:runtime";
88

99
routes.set("/runtime/get-vcpu-ms", () => {
1010
const cpuTime = vCpuTime();
11-
console.log(cpuTime);
1211
strictEqual(typeof cpuTime, 'number');
13-
console.log('3');
1412
ok(cpuTime > 0);
1513
ok(cpuTime < 1000);
16-
console.log('4');
1714
const arr = [];
1815
for (let i = 0; i < 1000; i++) {
1916
arr.push(i);
@@ -22,5 +19,5 @@ routes.set("/runtime/get-vcpu-ms", () => {
2219
ok(cpuTime2 > cpuTime);
2320
ok(cpuTime2 - cpuTime > 1);
2421
ok(cpuTime2 - cpuTime < 1000);
25-
return pass();
22+
return pass('ok');
2623
});

runtime/fastly/builtins/fastly.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ bool runtime_get_vcpu_time(JSContext *cx, unsigned argc, JS::Value *vp) {
227227
HANDLE_ERROR(cx, *err);
228228
return false;
229229
}
230-
fprintf(stderr, "GOT: %llu", res.unwrap());
231230
args.rval().setNumber(res.unwrap());
232231
return true;
233232
}

0 commit comments

Comments
 (0)