Skip to content

Commit

Permalink
Add process-spawn task
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Sep 19, 2021
1 parent 8c5bf2a commit c3308c5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions benchmark/tasks.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
// This is an example of tasks, used mostly for debugging
import { execFile } from 'child_process'
import { randomInt, createHash } from 'crypto'
import { promises as fs } from 'fs'
// eslint-disable-next-line no-shadow
import { setTimeout } from 'timers/promises'
import { promisify } from 'util'

import { tmpName } from 'tmp-promise'

const pExecFile = promisify(execFile)

const CURRENT_URL = new URL(import.meta.url)

// The fastest possible task
Expand Down Expand Up @@ -74,6 +78,11 @@ export const write = {
},
}

// Process-spawning-bound task
export const spawn = async function () {
await pExecFile('node', ['--version'])
}

// Task with a high complexity mimicking real tasks
export const complex = async () => {
await import('spyd')
Expand Down

0 comments on commit c3308c5

Please sign in to comment.