mil.dod.th.ose.bbb.platform/src/mil/dod/th/ose/bbb/platform/BeagleBoneBlackWakeManager.java
private long determineSleepTime()
    {
        long sleepTime = m_MaxSleepTimeMs / SECOND_MS;
        
        final BeagleBoneBlackLockInfo nextScheduledLock = m_BeagleBoneBlackWakeLockMgr.getNextScheduledLock();
        if (nextScheduledLock != null)
        {
            // Wake locks are scheduled based on system or wall clock time, so System.currentTimeMillis() must be used
            // to calculate the sleep time.
            final long timeOffset = (nextScheduledLock.getStartTimeMs() - System.currentTimeMillis()) / SECOND_MS;
            if (timeOffset > 0 && timeOffset < sleepTime)
            {
                sleepTime = timeOffset;
            }
        }
        return sleepTime;
    }
/**
     * Method that determine the amount of time system should sleep for based on the currently scheduled wake locks.
     * 
     * @return
     *      Time in seconds in the system should sleep.
     */
Method that determine the amount of time system should sleep for based on the currently scheduled wake locks.

@return
Time in seconds in the system should sleep.
Method that determine the amount of time system should sleep for based on the currently scheduled wake locks . @return Time in seconds in the system should sleep .
private long determineSleepTime()
    {
        long sleepTime = m_MaxSleepTimeMs / SECOND_MS;
        final BeagleBoneBlackLockInfo nextScheduledLock = m_BeagleBoneBlackWakeLockMgr.getNextScheduledLock();
        if (nextScheduledLock != null)
        {
            final long timeOffset = (nextScheduledLock.getStartTimeMs() - System.currentTimeMillis()) / SECOND_MS;
            if (timeOffset > 0 && timeOffset < sleepTime)
            {
                sleepTime = timeOffset;
            }
        }
        return sleepTime;
    }
private long determineSleepTime ( ) { long sleepTime = m_MaxSleepTimeMs / SECOND_MS ; final BeagleBoneBlackLockInfo nextScheduledLock = m_BeagleBoneBlackWakeLockMgr . getNextScheduledLock ( ) ; if ( nextScheduledLock != null ) { final long timeOffset = ( nextScheduledLock . getStartTimeMs ( ) - System . currentTimeMillis ( ) ) / SECOND_MS ; if ( timeOffset > 0 && timeOffset < sleepTime ) { sleepTime = timeOffset ; } } return sleepTime ; }
Method that determine the amount of time system should sleep for based on the currently scheduled wake locks.
Method that determine the amount of time system should sleep for based on the currently scheduled wake locks .
// Wake locks are scheduled based on system or wall clock time, so System.currentTimeMillis() must be used // to calculate the sleep time.