本文整理汇总了C++中value_type::Timestamp方法的典型用法代码示例。如果您正苦于以下问题:C++ value_type::Timestamp方法的具体用法?C++ value_type::Timestamp怎么用?C++ value_type::Timestamp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类value_type
的用法示例。
在下文中一共展示了value_type::Timestamp方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EventWriteHandler
void clientTask::EventWriteHandler(const value_type & data)
{
if (this->BenchmarkDoneMember == false) {
if (this->NumberOfskippedElement < confNumberOfSamplesToSkip) {
this->NumberOfskippedElement++;
} else {
double originalTime = data.Timestamp();
double currentTime = TimeServer->GetRelativeTime();
this->Samples.Element(this->SamplesCollected) = (currentTime - originalTime);
this->SamplesCollected++;
}
}
if (this->SamplesCollected == confNumberOfSamples) {
this->BenchmarkDoneMember = true;
double average = Samples.SumOfElements() / Samples.size();
double min = 0.0;
double max = 0.0;
Samples.MinAndMaxElement(min, max);
std::cout << "csc: client->server->client: client write data (queued), server triggers event (queued)" << std::endl
<< "csc: Client period (ms): " << cmnInternalTo_ms(confClientPeriod) << std::endl
<< "csc: Server period (ms): " << cmnInternalTo_ms(confServerPeriod) << std::endl
<< "csc: Size of elements used (in bytes): " << sizeof(value_type) << std::endl
<< "csc: Number of samples: " << this->SamplesCollected << std::endl
<< "csc: Average (ms): " << cmnInternalTo_ms(average) << std::endl
<< "csc: Standard deviation (ms): " << cmnInternalTo_ms(StandardDeviation(this->Samples)) << std::endl
<< "csc: Min (ms): " << cmnInternalTo_ms(min) << std::endl
<< "csc: Max (ms): " << cmnInternalTo_ms(max) << std::endl;
this->SamplesCollected++; // just to avoid printing results again
}
}