DefinitelyTyped/types/gc-stats/gc-stats-tests.ts
2018-08-21 10:53:25 +01:00

12 lines
400 B
TypeScript

import GCStats = require("gc-stats");
import { GCStatistics } from "gc-stats";
const gcStats = GCStats();
gcStats.on("stats", (stats: GCStatistics) => {
const { gctype: gcType, startTime, endTime, before, after, diff } = stats;
const beforeMallocedMemory = before.mallocedMemory;
const afterMallocedMemory = after.mallocedMemory;
const diffMallocedMemory = diff.mallocedMemory;
});