jan/web/utils/memory.ts
2024-08-29 12:55:07 +07:00

10 lines
226 B
TypeScript

/**
* Calculate the percentage of memory used
* @param free
* @param total
* @returns
*/
export const utilizedMemory = (free: number, total: number) => {
return Math.round(((total - free) / Math.max(total, 1)) * 100)
}