Commit 91fb0471 authored by Jean-Philippe Steinmetz's avatar Jean-Philippe Steinmetz
Browse files

Adding sleep utility function

parent 96039b75
......@@ -19,4 +19,5 @@ export { default as SimpleMongoEntity } from "./models/SimpleMongoEntity";
export { default as IndexRoute } from "./routes/IndexRoute";
export { default as ModelRoute } from "./routes/ModelRoute";
export { default as OpenAPIRoute } from "./routes/OpenAPIRoute";
export { default as ObjectFactory } from "./ObjectFactory";
\ No newline at end of file
export { default as ObjectFactory } from "./ObjectFactory";
export * as sleep from "./utils/sleep";
\ No newline at end of file
///////////////////////////////////////////////////////////////////////////////
// Copyright (C) AcceleratXR, Inc. All rights reserved.
///////////////////////////////////////////////////////////////////////////////
/**
* Starts a timer to suspend execution for a given number of milliseconds.
* @param ms The number of milliseconds to suspend. Default is `1`.
*/
export default async function(ms: number = 1): Promise<void> {
return new Promise((resolve) => {
setTimeout(async () => {
resolve();
}, ms);
});
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment