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

Function xs_time_delta

modules/base/time/lin/modTime.c:51–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51void xs_time_delta(xsMachine *the)
52{
53 xsNumberValue start, end;
54
55 start = xsToNumber(xsArg(0));
56 if (xsToNumber(xsArgc) > 1)
57 end = xsToNumber(xsArg(1));
58 else {
59 c_timeval tv;
60 c_gettimeofday(&tv, NULL);
61 end = ((double)(tv.tv_sec) * 1000.0) + ((double)(tv.tv_usec / 1000));
62 }
63 xsResult = xsNumber(end - start);
64}

Callers

nothing calls this directly

Calls 1

c_gettimeofdayFunction · 0.85

Tested by

no test coverage detected