refactor: convert benchmarks code to ESM
[poolifier.git] / benchmarks / versus-external-pools / fixed-poolifier.mjs
similarity index 83%
rename from benchmarks/versus-external-pools/fixed-poolifier.js
rename to benchmarks/versus-external-pools/fixed-poolifier.mjs
index 2a5e599ab11aefc0948bb8ec208f3650ede4e02f..aa922be8a9928651519572177eeb728cb9fe72b3 100644 (file)
@@ -1,5 +1,5 @@
 // IMPORT LIBRARIES
-const { FixedThreadPool } = require('poolifier')
+import { FixedThreadPool } from 'poolifier'
 // FINISH IMPORT LIBRARIES
 const size = parseInt(process.env.POOL_SIZE)
 const iterations = parseInt(process.env.NUM_ITERATIONS)
@@ -11,7 +11,7 @@ const data = {
 
 const fixedPool = new FixedThreadPool(
   size,
-  './workers/poolifier/function-to-bench-worker.js'
+  './workers/poolifier/function-to-bench-worker.mjs'
 )
 
 async function run () {
@@ -24,4 +24,4 @@ async function run () {
   process.exit()
 }
 
-run()
+await run()