MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxSendProfilerSamples

Function fxSendProfilerSamples

xs/sources/xsDebug.c:3432–3462  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3430}
3431
3432void fxSendProfilerSamples(txMachine* the, txProfiler* profiler)
3433{
3434#ifdef mxDebug
3435 if (fxIsConnected(the)) {
3436 txID* samples = profiler->samples;
3437 txSize sampleSize = profiler->sampleSize;
3438 txSize sampleIndex = 0;
3439 txID* ids;
3440 txID id;
3441 fxEchoStart(the);
3442 fxEcho(the, "<ps>");
3443 for (;;) {
3444 fxEchoUnsigned(the, profiler->deltas[sampleIndex], 36);
3445 ids = samples;
3446 while ((id = *ids++)) {
3447 fxEcho(the, ",");
3448 fxEchoUnsigned(the, id, 36);
3449 }
3450 sampleIndex++;
3451 if (sampleIndex < mxProfilerSampleCount)
3452 fxEcho(the, ",0.");
3453 else {
3454 fxEcho(the, ",0</ps>");
3455 break;
3456 }
3457 samples += sampleSize;
3458 }
3459 fxEchoStop(the);
3460 }
3461#endif
3462}
3463
3464void fxSendProfilerTime(txMachine* the, txString name, txMicroseconds when)
3465{

Callers 1

fxCheckProfilerFunction · 0.85

Calls 5

fxEchoStartFunction · 0.85
fxEchoFunction · 0.85
fxEchoUnsignedFunction · 0.85
fxEchoStopFunction · 0.85
fxIsConnectedFunction · 0.70

Tested by

no test coverage detected