agsamantha/node_modules/langchain/dist/util/time.js

11 lines
305 B
JavaScript
Raw Normal View History

2024-10-02 20:15:21 +00:00
/**
* Sleep for a given amount of time.
* @param ms - The number of milliseconds to sleep for. Defaults to 1000.
* @returns A promise that resolves when the sleep is complete.
*/
export async function sleep(ms = 1000) {
return new Promise((resolve) => {
setTimeout(resolve, ms);
});
}