MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / addRemove

Function addRemove

apps/ui/src/perf/properties/tests.ts:9–30  ·  view source on GitHub ↗
(counts: Array<number>, parent: LayoutBase)

Source from the content-addressed store, hash-verified

7const colors = ['red', 'green'];
8
9export function addRemove(counts: Array<number>, parent: LayoutBase): string {
10 let result = `addRemove`;
11 counts.forEach((count) => {
12 if (count > 10000) {
13 result += setResultTime(noValue);
14
15 return;
16 }
17
18 const lbl = new Label();
19 const time = executeTest(() => {
20 for (let i = 0; i < count; i++) {
21 parent.addChild(lbl);
22 parent.removeChild(lbl);
23 }
24 });
25
26 result += setResultTime(time);
27 });
28
29 return result;
30}
31
32export function setText(counts: Array<number>, parent?: LayoutBase): string {
33 let result = `setText ${parent ? 'with nativeView' : ''}`;

Callers

nothing calls this directly

Calls 5

setResultTimeFunction · 0.85
executeTestFunction · 0.85
forEachMethod · 0.80
addChildMethod · 0.45
removeChildMethod · 0.45

Tested by

no test coverage detected