本文整理汇总了C++中TimeSpan::SetRandSeed方法的典型用法代码示例。如果您正苦于以下问题:C++ TimeSpan::SetRandSeed方法的具体用法?C++ TimeSpan::SetRandSeed怎么用?C++ TimeSpan::SetRandSeed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimeSpan
的用法示例。
在下文中一共展示了TimeSpan::SetRandSeed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _ReadParametersFromCmdLine
//.........这里部分代码省略.........
if (NULL == synch->hStopEvent)
{
fprintf(stderr, "Error creating/opening force-stop event: '%s'\n", arg + 2);
exit(1); // TODO: this class shouldn't terminate the process
}
break;
case 'e':
{
HANDLE hEvent = OpenEvent(EVENT_MODIFY_STATE, FALSE, arg + 2);
if (NULL == hEvent)
{
fprintf(stderr, "Error opening event '%s'\n", arg + 2);
exit(1); // TODO: this class shouldn't terminate the process
}
if (!SetEvent(hEvent))
{
fprintf(stderr, "Error setting event '%s'\n", arg + 2);
exit(1); // TODO: this class shouldn't terminate the process
}
CloseHandle(hEvent);
printf("Succesfully set event: '%s'\n", arg + 2);
bExit = true;
break;
}
default:
fError = true;
}
case 'z': //random seed
if (*(arg + 1) == '\0')
{
timeSpan.SetRandSeed((ULONG)GetTickCount64());
}
else
{
int c = atoi(arg + 1);
if (c >= 0)
{
timeSpan.SetRandSeed(c);
}
else
{
fError = true;
}
}
break;
case 'Z': //zero write buffers
if (*(arg + 1) == '\0')
{
for (auto i = vTargets.begin(); i != vTargets.end(); i++)
{
i->SetZeroWriteBuffers(true);
}
}
else
{
UINT64 cb = 0;
string sPath;
if (_GetRandomDataWriteBufferData(string(arg + 1), cb, sPath) && (cb > 0))
{
for (auto i = vTargets.begin(); i != vTargets.end(); i++)
{
i->SetRandomDataWriteBufferSize(cb);