Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
composerjs
composer-service-core
Commits
91fb0471
Commit
91fb0471
authored
Feb 12, 2021
by
Jean-Philippe Steinmetz
Browse files
Adding sleep utility function
parent
96039b75
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/service_core.ts
View file @
91fb0471
...
...
@@ -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
src/utils/sleep.ts
0 → 100644
View file @
91fb0471
///////////////////////////////////////////////////////////////////////////////
// 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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment