diff --git a/docs/content/docs/api.md b/docs/content/docs/api.md index 9f341c7..8e887a0 100644 --- a/docs/content/docs/api.md +++ b/docs/content/docs/api.md @@ -131,12 +131,13 @@ Argument is optional and defaults to the lock expiration time. ### `getRemainingTime` -Get the remaining time before the lock expires. +Get the remaining time in milliseconds before the lock expires. ```ts const lock = verrou.createLock('key', '10s') await lock.acquire() +// returns remaining time for the lock in milliseconds const remainingTime = lock.getRemainingTime() ``` diff --git a/packages/verrou/src/lock.ts b/packages/verrou/src/lock.ts index 9bba677..62fdcc1 100644 --- a/packages/verrou/src/lock.ts +++ b/packages/verrou/src/lock.ts @@ -174,7 +174,7 @@ export class Lock { } /** - * Get the remaining time before the lock expires + * Get the remaining time in milliseconds before the lock expires */ getRemainingTime() { if (this.#expirationTime === null) return null