MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / retry

Function retry

apps/automated/src/profiling/profiling-tests.ts:49–61  ·  view source on GitHub ↗
(count: number, action: () => void)

Source from the content-addressed store, hash-verified

47disable();
48
49function retry(count: number, action: () => void) {
50 for (var i = 1; i <= count; i++) {
51 try {
52 action();
53
54 return;
55 } catch (e) {
56 if (i === count) {
57 throw e;
58 }
59 }
60 }
61}
62
63export function test_time_returns_number() {
64 assertEqual(typeof time(), 'number');

Callers 3

test_reentrancyFunction · 0.85

Calls 1

actionFunction · 0.50

Tested by

no test coverage detected