Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc50424d

Browse files
committed
Add script to test finding runtime
1 parent821ce10 commitc50424d

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

‎scripts/find-runtime.ts‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// benchmark
2+
conststart=process.hrtime.bigint();
3+
4+
// start code
5+
constargs=process.argv.slice(2);
6+
7+
if(args.length===0){
8+
console.log(`
9+
Usage: node find-runtime.mjs <project-folder>
10+
Find @rescript/runtime directories in a project's node_modules.
11+
Arguments:
12+
project-folder Path to the project directory to search
13+
Examples:
14+
node find-runtime.mjs /path/to/project
15+
node find-runtime.mjs .
16+
`);
17+
process.exit(1);
18+
}
19+
20+
constproject=args[args.length-1];
21+
22+
import{findRuntime}from"../server/src/find-runtime.ts";
23+
24+
construntimes=awaitfindRuntime(project);
25+
26+
console.log("Found @rescript/runtime directories:",runtimes);
27+
28+
// end code
29+
constend=process.hrtime.bigint();
30+
constdurationMs=Number(end-start)/1e6;// convert ns → ms
31+
32+
console.log(`Script took${durationMs.toFixed(3)}ms`);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp