本文整理汇总了C++中TimeSpan::SetCompletionRoutines方法的典型用法代码示例。如果您正苦于以下问题:C++ TimeSpan::SetCompletionRoutines方法的具体用法?C++ TimeSpan::SetCompletionRoutines怎么用?C++ TimeSpan::SetCompletionRoutines使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimeSpan
的用法示例。
在下文中一共展示了TimeSpan::SetCompletionRoutines方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _ReadParametersFromCmdLine
//.........这里部分代码省略.........
{
c = atoi(arg + 1);
if (c < 0 || c > 100)
{
c = -1;
fError = true;
}
}
if (c != -1)
{
for (auto i = vTargets.begin(); i != vTargets.end(); i++)
{
i->SetWriteRatio(c);
}
}
}
break;
case 'W': //warm up time
{
int c = atoi(arg + 1);
if (c >= 0)
{
timeSpan.SetWarmup(c);
}
else
{
fError = true;
}
}
break;
case 'x': //completion routines
timeSpan.SetCompletionRoutines(true);
break;
case 'y': //external synchronization
switch (*(arg + 1))
{
case 's':
_hEventStarted = CreateEvent(NULL, TRUE, FALSE, arg + 2);
if (NULL == _hEventStarted)
{
fprintf(stderr, "Error creating/opening start notification event: '%s'\n", arg + 2);
exit(1); // TODO: this class shouldn't terminate the process
}
break;
case 'f':
_hEventFinished = CreateEvent(NULL, TRUE, FALSE, arg + 2);
if (NULL == _hEventFinished)
{
fprintf(stderr, "Error creating/opening finish notification event: '%s'\n", arg + 2);
exit(1); // TODO: this class shouldn't terminate the process
}
break;
case 'r':
synch->hStartEvent = CreateEvent(NULL, TRUE, FALSE, arg + 2);
if (NULL == synch->hStartEvent)
{
fprintf(stderr, "Error creating/opening wait-for-start event: '%s'\n", arg + 2);
exit(1); // TODO: this class shouldn't terminate the process
}
break;