mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 18:20:27 +00:00
* Experimental. * Getting somewhere. * Good zooming behaviour. * Working timeline zooming & panning. * Clickable timestamps. * Dragging cursor * Timeline panning buttons. * Capping at current time. * Scale limits. * Better ticks. * Time tags fading in smoothly. * Removed seconds. * Better tick spacing. * Vertical panning as zooming. * Organizing the code.. * Replaced d3-zoom with native events. * Got rid of scaleX * More code beautified. * Almost done polishing the code. * Some cleanup. * Better request triggers. * More cleaning up. * Styled the timestamp input. * Final cleanup. * Update yarn.lock * Zoom tracking. * Animate timeline translations. * Fixed the PAUSE button glitch and updating the time control info. * Opacity fix and timeline arrows removed. * Fixed the red vertical bar. * Use preventDefault() on timeline scrolling.
19 lines
448 B
JavaScript
19 lines
448 B
JavaScript
import expect from 'expect';
|
|
import { timer } from '../time-utils';
|
|
|
|
describe('timer', () => {
|
|
it('records how long a function takes to execute', () => {
|
|
const add100k = (number) => {
|
|
for (let i = 0; i < 100000; i += 1) {
|
|
number += 1;
|
|
}
|
|
return number;
|
|
};
|
|
|
|
const timedFn = timer(add100k);
|
|
const result = timedFn(70);
|
|
expect(result).toEqual(100070);
|
|
expect(timedFn.time).toBeA('number');
|
|
});
|
|
});
|