Skip to content

Commit

Permalink
Measure the correct time of API calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Jul 1, 2016
1 parent 5725c2b commit c6520af
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Compiler/Template/GenerateAPIFunctionsTpl.tpl
Expand Up @@ -384,25 +384,27 @@ template getQtInterfaceFunc(String name, list<DAE.FuncArg> args, DAE.Type res, S
<<
<%getQtInterfaceHeader(name, '<%className%>', args, res, className, false)%>
{
QTime commandTime;
commandTime.start();
emit logCommand("<%replaceDotAndUnderscore(name)%>("+<%if intGt(listLength(args), 0) then commandArgs else 'QString("")'%>+")", &commandTime);
<%varDecl%>
try {
MMC_TRY_TOP_INTERNAL()
QTime commandTime;
commandTime.start();
emit logCommand("<%replaceDotAndUnderscore(name)%>("+<%if intGt(listLength(args), 0) then commandArgs else 'QString("")'%>+")", &commandTime);
st = omc_OpenModelicaScriptingAPI_<%replaceDotAndUnderscore(name)%>(threadData, st<%inArgs%><%outArgs%>);
<%postCall%>
QString responseLog;
<%responseLog%>
emit logResponse(responseLog, &commandTime);
MMC_CATCH_TOP()
} catch(std::exception &exception) {
emit throwException(QString("<%replaceDotAndUnderscore(name)%> failed. %1").arg(exception.what()));
}

QString responseLog;
<%responseLog%>
emit logResponse(responseLog, &commandTime);

<%if outArgs then "return result;"%>
}
>>
Expand Down

0 comments on commit c6520af

Please sign in to comment.