本文整理汇总了C++中NanoTimer::min方法的典型用法代码示例。如果您正苦于以下问题:C++ NanoTimer::min方法的具体用法?C++ NanoTimer::min怎么用?C++ NanoTimer::min使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NanoTimer
的用法示例。
在下文中一共展示了NanoTimer::min方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SQLPrepare
int
runDeleteTest (SQLHANDLE henv, SQLHANDLE hdbc, SQLHANDLE hstmt)
{
int rc;
int iHolder;
rc = SQLPrepare (hstmt, (unsigned char *)
"DELETE FROM t1 WHERE f1 = ?", SQL_NTS);
checkrc (rc, __LINE__);
rc = SQLBindParameter (hstmt, 1, SQL_PARAM_INPUT, SQL_C_LONG, SQL_INTEGER,
0, 0, &iHolder, 0, NULL);
checkrc (rc, __LINE__);
iHolder = 0;
int i, j, k;
int tCount;
timer.reset ();
/* Run 1per Test */
for (i = START; i < (START+ITERATION); i++)
{
timer.start ();
iHolder = i ;
rc = SQLExecute (hstmt);
checkrc (rc, __LINE__);
rc = SQLTransact (henv, hdbc, SQL_COMMIT);
checkrc (rc, __LINE__);
timer.stop ();
}
printf ("Delete: 1 %lld %lld %lld\n", timer.min (), timer.max (),
timer.avg ());
return 0;
}
示例2: readOnlyTrans
int
runReadTest (SQLHANDLE henv, SQLHANDLE hdbc, SQLHANDLE hstmt)
{
int iHolder;
int second;
char sHolder[200];
char sData[200];
int tempTermVar = 0;
int tempTermVal = 0;
int rc;
/* Set read-only transaction type */
readOnlyTrans (hdbc);
rc = SQLPrepare (hstmt, (unsigned char *)
"SELECT f1, f2 FROM t1 where f1 = ?", SQL_NTS);
checkrc (rc, __LINE__);
long sz = 0;
rc = SQLBindParameter (hstmt, 1, SQL_PARAM_INPUT, SQL_C_LONG, SQL_INTEGER,
0, 0, &tempTermVar, 0, NULL);
checkrc (rc, __LINE__);
rc = SQLBindCol (hstmt, 1, SQL_INTEGER, &iHolder, 0, NULL);
checkrc (rc, __LINE__);
rc = SQLBindCol (hstmt, 2, SQL_INTEGER, &second, 0, NULL);
checkrc (rc, __LINE__);
iHolder = 0;
strcpy (sData, "0123456789012345678901234567890123456789");
int i, j, k;
int tCount;
timer.reset ();
/* Run 1per Test */
for (i = START; i < (START+ITERATION); i++)
{
timer.start ();
tempTermVar = i ;
rc = SQLExecute (hstmt);
checkrc (rc, __LINE__);
rc = SQLFetch (hstmt);
checkrc (rc, __LINE__);
tempTermVal = iHolder;
strcpy (sData, sHolder);
rc = SQLCloseCursor (hstmt);
checkrc (rc, __LINE__);
rc = SQLTransact (henv, hdbc, SQL_COMMIT);
checkrc (rc, __LINE__);
timer.stop ();
}
printf ("Read: 1 %lld %lld %lld\n", timer.min (), timer.max (),
timer.avg ());
/* Set read-write transaction type */
readWriteTrans (hdbc);
return rc;
}
示例3: strcpy
int
runInsertTest (SQLHANDLE henv, SQLHANDLE hdbc, SQLHANDLE hstmt)
{
int rc;
int iHolder;
char sHolder[200];
char sData[200];
iHolder = 0;
strcpy (sData, "0123456789012345678901234567890123456789");
rc = SQLPrepare (hstmt, (unsigned char *) "insert into t1 values(?,12,13,14,15,16,17,18,19,20,21,100,100,'AXXXXXXXXXXXXXXXXXXXXXXXXXCXXXXXXXXXXXXXXXXXXXXXXXX','GXXXXXXXXXXXXXXXXXXXXXXXXXCXXXXXXXXXXXXXXXXXXXXXXXXA','OXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXXXXXXXXXXXXXXXXXXO')", SQL_NTS);
checkrc (rc, __LINE__);
rc = SQLBindParameter (hstmt, 1, SQL_PARAM_INPUT, SQL_C_LONG, SQL_INTEGER,
0, 0, &iHolder, 0, NULL);
checkrc (rc, __LINE__);
SQLINTEGER sLen = SQL_NTS;
/* rc = SQLBindParameter (hstmt, 2, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR,
196, 0, (void *) sHolder, 0, &sLen);*/
checkrc (rc, __LINE__);
int i, j, k;
int tCount;
timer.reset ();
/* Run 1per Test */
for (i = START; i<(START + ITERATION); i++)
{
timer.start ();
iHolder = i ;
strcpy (sHolder, sData);
rc = SQLExecute (hstmt);
checkrc (rc, __LINE__);
rc = SQLTransact (henv, hdbc, SQL_COMMIT);
checkrc (rc, __LINE__);
timer.stop ();
}
printf ("Insert: 1 %lld %lld %lld\n", timer.min (), timer.max (),
timer.avg ());
return 0;
}