本文整理汇总了C++中PerfMeasurement类的典型用法代码示例。如果您正苦于以下问题:C++ PerfMeasurement类的具体用法?C++ PerfMeasurement怎么用?C++ PerfMeasurement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PerfMeasurement类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pm_canMeasureSomething
static JSBool
pm_canMeasureSomething(JSContext* cx, unsigned /*unused*/, jsval* vp)
{
PerfMeasurement* p = GetPMFromThis(cx, vp);
if (!p)
return JS_FALSE;
JS_SET_RVAL(cx, vp, BOOLEAN_TO_JSVAL(p->canMeasureSomething()));
return JS_TRUE;
}
示例2: pm_reset
static JSBool
pm_reset(JSContext* cx, unsigned /*unused*/, jsval* vp)
{
PerfMeasurement* p = GetPMFromThis(cx, vp);
if (!p)
return JS_FALSE;
p->reset();
return JS_TRUE;
}
示例3: pm_stop
static JSBool
pm_stop(JSContext* cx, uintN /*unused*/, jsval* vp)
{
PerfMeasurement* p = GetPMFromThis(cx, vp);
if (!p)
return JS_FALSE;
p->stop();
return JS_TRUE;
}
示例4: pm_canMeasureSomething
static bool
pm_canMeasureSomething(JSContext* cx, unsigned argc, Value* vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
PerfMeasurement* p = GetPM(cx, args.thisv(), "canMeasureSomething");
if (!p)
return false;
args.rval().setBoolean(p->canMeasureSomething());
return true;
}
示例5: pm_reset
static bool
pm_reset(JSContext* cx, unsigned argc, Value* vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
PerfMeasurement* p = GetPM(cx, args.thisv(), "reset");
if (!p)
return false;
p->reset();
args.rval().setUndefined();
return true;
}
示例6: pm_stop
static bool
pm_stop(JSContext* cx, unsigned argc, jsval* vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
PerfMeasurement* p = GetPM(cx, args.thisv(), "stop");
if (!p)
return false;
p->stop();
args.rval().setUndefined();
return true;
}