diff options
| author | JP Dillingham <jp@dillingham.me> | 2022-05-17 09:59:44 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2022-05-17 09:59:44 -0500 |
| commit | 30d5f990c5bd0a5519f3a8242c91a23d663d8b60 (patch) | |
| tree | 2548ac5cceeda6ef4e060a3c60a8b2d89ca5b075 /src/web | |
| parent | d303e5e03cb09f51ea04cc259667ed502406dc70 (diff) | |
| download | slskd-30d5f990c5bd0a5519f3a8242c91a23d663d8b60.tar.gz | |
add sleep function
Diffstat (limited to 'src/web')
| -rw-r--r-- | src/web/src/lib/util.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/web/src/lib/util.js b/src/web/src/lib/util.js index 9721fbeb..1704a990 100644 --- a/src/web/src/lib/util.js +++ b/src/web/src/lib/util.js @@ -48,6 +48,10 @@ export const formatAttributes = ({ bitRate, isVariableBitRate, bitDepth, sampleR return bitRate ? `${bitRate} Kbps` : '' } +export const sleep = (milliseconds) => { + return new Promise(resolve => setTimeout(resolve, milliseconds)) +} + /* https://www.npmjs.com/package/js-file-download * * Copyright 2017 Kenneth Jiang |
