MCPcopy Create free account
hub / github.com/NativeScript/android / SimpleProfiler

Method SimpleProfiler

test-app/runtime/src/main/cpp/SimpleProfiler.cpp:12–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10
11
12SimpleProfiler::SimpleProfiler(char* fileName, int lineNumber)
13 :
14 m_frame(nullptr), m_time(0) {
15 for (auto& f : s_frames) {
16 if ((f.fileName == fileName) && (f.lineNumber == lineNumber)) {
17 m_frame = &f;
18 break;
19 }
20 }
21 if (m_frame == nullptr) {
22 FrameEntry entry(fileName, lineNumber);
23 s_frames.push_back(entry);
24 m_frame = &s_frames.back();
25 }
26 ++m_frame->stackCount;
27 if (m_frame->stackCount == 1) {
28 struct timespec nowt;
29 clock_gettime(CLOCK_MONOTONIC, &nowt);
30 m_time = (int64_t) nowt.tv_sec * 1000000000LL + nowt.tv_nsec;
31 }
32}
33
34SimpleProfiler::~SimpleProfiler() {
35 --m_frame->stackCount;

Callers

nothing calls this directly

Calls 1

backMethod · 0.80

Tested by

no test coverage detected