예제 #1
0
snd_pcm_sframes_t Sender::Impl::_estimate_frames() const {
    if ((m_status & Sender::usRunning) == 0 || m_status == Sender::usPaused ||
            m_status == Sender::usUnderrun)
        return m_nLastFrames;

    // Wasn't started.
    if (m_startTime == TimePoint())
        return m_nLastFrames;

    if (m_wakeup.check()) {
        m_pPlug->log.info("Woken up from suspend");
        m_nLastFrames = m_pPlug->appl_ptr;
        m_startTime = Clock::now();
        m_wakeup.reset();
        return m_nLastFrames;
    }

    Duration ms(std::chrono::duration_cast<Duration>(Clock::now() - m_startTime));

    return m_nLastFrames + ms.count()*(m_pPlug->get_rate()/1000.0);
}
예제 #2
0
파일: Clock.cpp 프로젝트: Qarterd/Honeycomb
typename MonoClock<Subclass>::TimePoint MonoClock<Subclass>::now()
{
    return TimePoint(std::chrono::steady_clock::now().time_since_epoch().count());
}
예제 #3
0
파일: Clock.cpp 프로젝트: Qarterd/Honeycomb
typename SystemClock<Subclass>::TimePoint SystemClock<Subclass>::now()
{
    return TimePoint(std::chrono::system_clock::now().time_since_epoch().count());
}
예제 #4
0
HighResolutionClock::TimePoint HighResolutionClock::Now() {
  LARGE_INTEGER large_integer;
  VERIFY_TRUE(QueryPerformanceCounter(&large_integer), "QueryPerformanceCounter failed");
  int64 nanosecond_count = (1000 * 1000 * 1000 * (large_integer.QuadPart - g_start_time_)) / g_frequency_;
  return TimePoint(HighResolutionClock::Duration(nanosecond_count));
}
예제 #5
0
파일: Clock.cpp 프로젝트: Qarterd/Honeycomb
typename MonoClock<Subclass>::TimePoint MonoClock<Subclass>::now()
{
    LARGE_INTEGER now;
    verify(QueryPerformanceCounter(&now));
    return TimePoint(TimePoint::Duration((now.QuadPart - _start.QuadPart) * _toNano));
}
예제 #6
0
 inline TimePoint getAnimationTime() const {
     // We're casting the TimePoint to and from a Duration because libstdc++
     // has a bug that doesn't allow TimePoints to be atomic.
     return mode == MapMode::Continuous ? TimePoint(animationTime) : Clock::now();
 }
예제 #7
0
파일: RankDlg.cpp 프로젝트: astroluj/MFC
CRankDlg::CRankDlg(CString str, CString m, CString s, CString c, UINT cnt, CString lev, CString rank, UINT point, CWnd* pParent /*=NULL*/)
	: CDialogEx(CRankDlg::IDD, pParent)
{
	member =str ; nMin =m ; nSec =s, nCsec =c, nCnt =cnt ; strLev =lev ; rankName =rank ; nPoint =point ;
	TimePoint () ;	// 생성자로 초기화 함과 동시에 시간계산
}