本文整理汇总了C++中TimeDuration::total_milliseconds方法的典型用法代码示例。如果您正苦于以下问题:C++ TimeDuration::total_milliseconds方法的具体用法?C++ TimeDuration::total_milliseconds怎么用?C++ TimeDuration::total_milliseconds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimeDuration
的用法示例。
在下文中一共展示了TimeDuration::total_milliseconds方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: bufferingProcedure
void* Downloader::bufferingProcedure(void *receiver)
{
Downloader* downloader = (Downloader *) receiver;
uint32_t number = 0;
IBufferItem *media = downloader->adaptation->getSegment(number);
while(media != NULL)
{
Time t1(boost::posix_time::microsec_clock::local_time());
media->start();
media->wait();
Time t2(boost::posix_time::microsec_clock::local_time());
TimeDuration dt = t2 - t1;
downloader->buffer->push(media);
number++;
downloader->adaptation->setBufferStatus(downloader->buffer->size()*1.0);
downloader->adaptation->setDownloadTime(dt.total_milliseconds());
media = downloader->adaptation->getSegment(number);
}
downloader->buffer->setEnd(true);
return NULL;
}
示例2: sleep
inline void sleep(TimeDuration const& rel_time)
{
interruptible_wait(detail::pin_to_zero(rel_time.total_milliseconds()));
}
示例3: sleep
inline void sleep(TimeDuration const& rel_time)
{
interruptible_wait(static_cast<unsigned long>(rel_time.total_milliseconds()));
}
示例4: update
void AccelerationAction::update(TimeDuration delta) {
velocity_ += acceleration_ * delta.total_milliseconds();
if ((acceleration_ > 0 && velocity_ > targetVelocity_) || (acceleration_ < 0 && velocity_ < targetVelocity_)) {
velocity_ = targetVelocity_;
}
}
示例5: rand_range
TimeDuration rand_range(const TimeDuration& start, const TimeDuration& stop) {
unsigned int start_int = start.total_milliseconds();
unsigned int stop_int = stop.total_milliseconds();
return ptime::milliseconds(rr(start_int, stop_int));
}
示例6: double
double TimeDuration::operator /(const TimeDuration& b) const {
return double(total_milliseconds()) / double(b.total_milliseconds());
}
示例7: update
void CameraMoveAction::update(TimeDuration delta) {
AccelerationAction::update(delta);
camera_.moveRelative(direction_.normalised() * velocity() * delta.total_milliseconds());
}