Parcourir la source

add sleep util

Alexander Rose il y a 5 ans
Parent
commit
2757dfdb75
1 fichiers modifiés avec 9 ajouts et 0 suppressions
  1. 9 0
      src/mol-util/sleep.ts

+ 9 - 0
src/mol-util/sleep.ts

@@ -0,0 +1,9 @@
+/**
+ * Copyright (c) 2019 Mol* contributors, licensed under MIT, See LICENSE file for more info.
+ *
+ * @author Alexander Rose <alexander.rose@weirdbyte.de>
+ */
+
+export function sleep(milliseconds: number) {
+    return new Promise(resolve => setTimeout(resolve, milliseconds))
+}