Explorar el Código

add sleep util

Alexander Rose hace 5 años
padre
commit
2757dfdb75
Se han modificado 1 ficheros con 9 adiciones y 0 borrados
  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))
+}