10 lines
226 B
TypeScript
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)
|
|
}
|