소스 검색

add sleep util

Alexander Rose 5 년 전
부모
커밋
2757dfdb75
1개의 변경된 파일9개의 추가작업 그리고 0개의 파일을 삭제
  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))
+}