diff options
Diffstat (limited to 'src/node_perf.h')
-rw-r--r-- | src/node_perf.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/node_perf.h b/src/node_perf.h index 0db99acd03..703ef81ce4 100644 --- a/src/node_perf.h +++ b/src/node_perf.h @@ -27,6 +27,18 @@ extern const uint64_t timeOrigin; double GetCurrentTimeInMicroseconds(); +static inline const char* GetPerformanceMilestoneName( + enum PerformanceMilestone milestone) { + switch (milestone) { +#define V(name, label) case NODE_PERFORMANCE_MILESTONE_##name: return label; + NODE_PERFORMANCE_MILESTONES(V) +#undef V + default: + UNREACHABLE(); + return 0; + } +} + static inline PerformanceMilestone ToPerformanceMilestoneEnum(const char* str) { #define V(name, label) \ if (strcmp(str, label) == 0) return NODE_PERFORMANCE_MILESTONE_##name; @@ -44,12 +56,6 @@ static inline PerformanceEntryType ToPerformanceEntryTypeEnum( return NODE_PERFORMANCE_ENTRY_TYPE_INVALID; } -NODE_EXTERN inline void MarkPerformanceMilestone( - Environment* env, - PerformanceMilestone milestone) { - env->performance_state()->milestones[milestone] = PERFORMANCE_NOW(); -} - class PerformanceEntry { public: static void Notify(Environment* env, |