file copyright author Vivek M. Chawla <@VivekMChawla>
 *  summary description version license import { SfdxFalconDebug } from '../sfdx-falcon-debug' ; import { SfdxFalconError } from '../sfdx-falcon-error' ; const dbgNs = 'UTILITY:async:' ; function param { number } waitSecs param { boolean } convertToMs returns { Promise < void > } description export async function waitASecond ( waitSecs = 1 , convertToMs = true ) { SfdxFalconDebug . obj ( `${ dbgNs }waitASecond:arguments:` , arguments , `arguments: ` ) ; if ( isNaN ( waitSecs ) ) { throw new SfdxFalconError ( `Expected waitSecs to be a number, but got '${ typeof waitSecs }' instead` , `TypeError` , `${ dbgNs }waitASecond` ) ; } if ( convertToMs ) { waitSecs *= 1000 ; } return new Promise ( resolve => { setTimeout ( ( ) => resolve ( ) , waitSecs ) ; } ) ; }