0.0.10 • Published 1 year ago

timer-profiler v0.0.10

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

TimeProfiler

Timer/Profiler for measuring time elapsed of promises

todos

  • measure in microseconds instead of milliseconds
  • make profileLogSchema and logger not required
  • make the code agnostic to the logger, so add_logger is not automatically required if not needed
  • make the code agnostic to the model, so mongoose is not automatically required if not needed
  • use Jest to test
import { profile } from 'timer-profiler';


profile(
    () => fetch('https://api.exchangerate-api.com/v4/latest/USD'),
    {
        label: "forex fetch"
    }
)
.then(
  (response) => {
    console.log('');
    console.log('------');
    console.log('');
    console.log(response);
  }
);

Result:

forex fetch time elapsed: 736.977635 ms
0.0.10

1 year ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago