MCPcopy Index your code
hub / github.com/angular/angular / testAddRemove

Function testAddRemove

packages/zone.js/test/performance/performance_setup.js:129–167  ·  view source on GitHub ↗
(api, count)

Source from the content-addressed store, hash-verified

127 };
128
129 function testAddRemove(api, count) {
130 var timerId = [];
131
132 var name = api.method;
133 mark(name);
134 for (var i = 0; i < count; i++) {
135 timerId.push(api.run());
136 }
137 measure(name, name);
138
139 if (api.supportClear) {
140 var clearName = api.clearMethod;
141 mark(clearName);
142 for (var i = 0; i < count; i++) {
143 api.runClear(timerId[i]);
144 }
145 measure(clearName, clearName);
146 }
147
148 timerId = [];
149
150 var nativeName = getNativeMethodName(api.nativeMethod);
151 mark(nativeName);
152 for (var i = 0; i < count; i++) {
153 timerId.push(api.nativeRun());
154 }
155 measure(nativeName, nativeName);
156
157 if (api.supportClear) {
158 var nativeClearName = getNativeMethodName(api.nativeClearMethod);
159 mark(nativeClearName);
160 for (var i = 0; i < count; i++) {
161 api.nativeRunClear(timerId[i]);
162 }
163 measure(nativeClearName, nativeClearName);
164 }
165
166 return Promise.resolve(1);
167 }
168
169 function testCallback(api, count) {
170 var promises = [Promise.resolve(1)];

Callers 1

testFunctionFunction · 0.70

Calls 5

getNativeMethodNameFunction · 0.85
runMethod · 0.65
resolveMethod · 0.65
markFunction · 0.50
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…