0.0.10 • Published 10 months ago

timer-profiler v0.0.10

Weekly downloads
-
License
ISC
Repository
-
Last release
10 months 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

10 months ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago