UNPKG
atikin-eco-logger
Version:
latest (1.0.0)
1.0.0
A sustainable coding metrics tool for measuring energy consumption and runtime efficiency.
atikin-eco-logger
/
test.js
11 lines
(8 loc)
•
270 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
const
{ ecoLogger, logMetrics } =
require
(
'./index'
);
// Example function to test
function
exampleFunction
(
) {
for
(
let
i =
0
; i <
1e6
; i++) {}
// Simulate workload
}
const
metrics =
ecoLogger
(exampleFunction);
console
.
log
(metrics);
logMetrics
(metrics);