mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: using rpc to communicate
This commit is contained in:
parent
05cfdefc84
commit
328b7cb137
15 changed files with 332 additions and 298 deletions
13
src/main/services/download/helpers.ts
Normal file
13
src/main/services/download/helpers.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
export const calculateETA = (
|
||||
totalLength: number,
|
||||
completedLength: number,
|
||||
speed: number
|
||||
) => {
|
||||
const remainingBytes = totalLength - completedLength;
|
||||
|
||||
if (remainingBytes >= 0 && speed > 0) {
|
||||
return (remainingBytes / speed) * 1000;
|
||||
}
|
||||
|
||||
return -1;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue