octalmage / active-window

Get active window title in Node.js.
160 stars 51 forks source link

use milliseconds for Start-Sleep #7

Closed zenozeng closed 7 years ago

zenozeng commented 8 years ago

Use milliseconds for Start-Sleep, otherwise seconds less than 1 will be rounded down to 0 and that will cause PowerShell to use 100% CPU.

Parameter Set: Seconds
Start-Sleep [-Seconds] <Int32> [ <CommonParameters>]

Parameter Set: Milliseconds
Start-Sleep -Milliseconds <Int32> [ <CommonParameters>]

See also: https://technet.microsoft.com/en-us/library/hh849939.aspx


This change is Reviewable

robsonvn commented 8 years ago

Thanks mate, I'll check it out as soon as possible.

robsonvn commented 8 years ago

@octalmage Jason, in fact the bug exists and the solution works fine. Can you accept the pull request and release the new version on npm ?

octalmage commented 7 years ago

Sorry just saw this! I'll get a new version out.