File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change
1
+ < pre id ="output "> </ pre >
2
+ < p id ="instructions ">
3
+ Run < code > python -m http.server 2255</ code > ,
4
+ then open < a href ="http://localhost:2255/test/test_workers.html "> this file</ a > .
5
+ </ p >
6
+ < script >
7
+ for ( const dbg of [ "-debug" , "" ] ) {
8
+ for ( const asm of [ "-asm" , "-wasm" ] ) {
9
+ const url = `../dist/worker.sql${ asm } ${ dbg } .js` ;
10
+ const start_time = performance . now ( ) ;
11
+ const worker = new Worker ( url ) ;
12
+ worker . onmessage = ( e ) => {
13
+ output . textContent += `[${ url } ] [${ ( performance . now ( ) - start_time ) . toFixed ( 2 ) } ms] ${ JSON . stringify ( e . data ) } \n\n` ;
14
+ instructions . style . display = "none" ;
15
+ }
16
+ worker . onerror = ( e ) => {
17
+ output . textContent += `[error] [${ url } ] [${ ( performance . now ( ) - start_time ) . toFixed ( 2 ) } ms] ${ JSON . stringify ( e ) } \n\n` ;
18
+ }
19
+ worker . postMessage ( { "action" : "open" , "id" : 0 } ) ;
20
+ worker . postMessage ( { "action" : "close" , "id" : 0 } ) ;
21
+ }
22
+ }
23
+ </ script >
You can’t perform that action at this time.
0 commit comments