Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,10 @@ export class ProcessPromise extends Promise<ProcessOutput> {
return this
}

timeout(d: Duration, signal = $.timeoutSignal): ProcessPromise {
timeout(
d: Duration,
signal = this._timeoutSignal || $.timeoutSignal
): ProcessPromise {
if (this._resolved) return this

this._timeout = parseDuration(d)
Expand Down
12 changes: 12 additions & 0 deletions test/bench/buf-join.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,24 @@ cronometro({
buf_arr_reduce_decode() {
BUF_ARR.reduce((acc, buf) => acc + decoder.decode(buf), '')
},
buf_arr_reduce_to_string() {
BUF_ARR.reduce((acc, buf) => acc + buf.toString('utf8'), '')
},
buf_arr_for_decode() {
let res = ''
for (const buf of BUF_ARR) {
res += decoder.decode(buf)
}
},
buf_arr_while_decode() {
let res = ''
let i = 0
const bl = BUF_ARR.length
while (i < bl) {
res += decoder.decode(BUF_ARR[i])
i++
}
},
buf_arr_join() {
BUF_ARR.join('')
},
Expand Down