本文整理汇总了C++中phpret类的典型用法代码示例。如果您正苦于以下问题:C++ phpret类的具体用法?C++ phpret怎么用?C++ phpret使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了phpret类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: returnVals
void Profiler::returnVals(phpret& ret, const Name& name, const Counts& counts,
int flags, int64_t MHz)
{
ArrayInit arr(5, ArrayInit::Map{});
arr.set(s_ct, counts.count);
arr.set(s_wt, to_usec(counts.wall_time, MHz));
if (flags & TrackCPU) {
arr.set(s_cpu, to_usec(counts.cpu, MHz, true));
}
if (flags & TrackMemory) {
arr.set(s_mu, counts.memory);
arr.set(s_pmu, counts.peak_memory);
} else if (flags & TrackMalloc) {
arr.set(s_alloc, counts.memory);
arr.set(s_free, counts.peak_memory);
}
ret.set(String(name), arr.toArray());
}
示例2: returnVals
static void returnVals(phpret& ret, const Name& name, const Counts& counts,
int flags, int64 MHz)
{
Array arr;
arr.set("ct", counts.count);
arr.set("wt", to_usec(counts.wall_time, MHz));
if (flags & TrackCPU) {
arr.set("cpu", to_usec(counts.cpu, MHz));
}
if (flags & TrackMemory) {
arr.set("mu", counts.memory);
arr.set("pmu", counts.peak_memory);
} else if (flags & TrackMalloc) {
arr.set("alloc", counts.memory);
arr.set("free", counts.peak_memory);
}
ret.set(String(name), arr);
}