2022-04-07 00:00:21 +09:00
|
|
|
import { createRequire } from 'module'
|
|
|
|
|
|
|
|
import { displayMemoryUsageFromNode } from './util.mjs'
|
2021-05-28 19:50:16 +09:00
|
|
|
|
|
|
|
const initialMemoryUsage = process.memoryUsage()
|
|
|
|
|
2022-04-07 00:00:21 +09:00
|
|
|
const require = createRequire(import.meta.url)
|
|
|
|
|
2021-05-28 19:50:16 +09:00
|
|
|
const api = require(`./index.node`)
|
|
|
|
|
|
|
|
async function main() {
|
|
|
|
let i = 1
|
|
|
|
// eslint-disable-next-line no-constant-condition
|
|
|
|
while (true) {
|
|
|
|
await api.testAsync()
|
|
|
|
if (i % 100000 === 0) {
|
|
|
|
displayMemoryUsageFromNode(initialMemoryUsage)
|
|
|
|
}
|
|
|
|
i++
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
main().catch((e) => {
|
|
|
|
console.error(e)
|
|
|
|
process.exit(1)
|
|
|
|
})
|