[mpp_time]: Add AUTO_TIMING for C++ function

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I1ec9f6307dce44f7aa086911477b27e523904cdc
This commit is contained in:
Herman Chen
2020-04-18 15:23:54 +08:00
parent 9464af395b
commit 16047eb224
2 changed files with 34 additions and 1 deletions

View File

@@ -427,3 +427,15 @@ void mpp_timer_put(MppTimer timer)
impl = NULL;
}
}
AutoTiming::AutoTiming(const char *name)
{
mStart = mpp_time();
mName = name;
}
AutoTiming::~AutoTiming()
{
mEnd = mpp_time();
mpp_log("%s timing %lld us\n", mName, mEnd - mStart);
}