Sha256: 22b5dd3e136770ccfcf014aebb4730e7e568543c59c3aa46cf2606be06469428

Contents?: true

Size: 1.32 KB

Versions: 23

Compression:

Stored size: 1.32 KB

Contents

using System;

namespace rho.common
{
    public class TimeInterval
    {
        public TimeInterval() { m_nativeTime = 0; }

        public String toString()
        {
            long nMin = m_nativeTime / (60 * 1000);
            long nSec = (m_nativeTime - nMin * (60 * 1000)) / 1000;
            long mSec = m_nativeTime - nSec * 1000 - nMin * (60 * 1000);

            String strTime = nMin + ":" +
                nSec + ":" +
                mSec;

            return strTime;
        }

        public long toULong()
        {
            return m_nativeTime;
        }

        public TimeInterval minus(TimeInterval time)
        {
            TimeInterval res = new TimeInterval();
            res.m_nativeTime = m_nativeTime - time.m_nativeTime;
            return res;
        }

        public void addMillis(int nMs)
        {
            m_nativeTime += nMs;
        }

        public TimeInterval plusAssign(TimeInterval time)
        {
            m_nativeTime += time.m_nativeTime;
            return this;
        }

        public static TimeInterval getCurrentTime()
        {
            TimeInterval res = new TimeInterval();
            res.m_nativeTime = DateTime.Now.ToFileTime();
            return res;
        }

        public boolean isEmpty() { return m_nativeTime == 0; }

        private long m_nativeTime;
    }
}

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
rhodes-3.0.2 platform/wp7/RhoRubyLib/common/TimeInterval.cs
rhodes-3.0.2.beta.1 platform/wp7/RhoRubyLib/common/TimeInterval.cs
rhodes-3.0.1 platform/wp7/RhoRubyLib/common/TimeInterval.cs
rhodes-3.0.1.beta.8 platform/wp7/RhoRubyLib/common/TimeInterval.cs
rhodes-3.0.1.beta.7 platform/wp7/RhoRubyLib/common/TimeInterval.cs
rhodes-3.0.1.beta.6 platform/wp7/RhoRubyLib/common/TimeInterval.cs
rhodes-3.0.1.beta.5 platform/wp7/RhoRubyLib/common/TimeInterval.cs
rhodes-3.0.1.beta.4 platform/wp7/RhoRubyLib/common/TimeInterval.cs
rhodes-3.0.1.beta.3 platform/wp7/RhoRubyLib/common/TimeInterval.cs
rhodes-3.0.1.beta.2 platform/wp7/RhoRubyLib/common/TimeInterval.cs
rhodes-3.0.0 platform/wp7/RhoRubyLib/common/TimeInterval.cs
rhodes-3.0.0.beta.7 platform/wp7/RhoRubyLib/common/TimeInterval.cs
rhodes-3.0.0.beta.6 platform/wp7/RhoRubyLib/common/TimeInterval.cs
rhodes-3.0.0.beta.5 platform/wp7/RhoRubyLib/common/TimeInterval.cs
rhodes-3.0.0.beta.4 platform/wp7/RhoRubyLib/common/TimeInterval.cs
rhodes-3.0.0.beta.3 platform/wp7/RhoRubyLib/common/TimeInterval.cs
rhodes-3.0.0.beta.2 platform/wp7/RhoRubyLib/common/TimeInterval.cs
rhodes-3.0.0.beta.1 platform/wp7/RhoRubyLib/common/TimeInterval.cs
rhodes-2.4.1 platform/wp7/RhoRubyLib/common/TimeInterval.cs
rhodes-2.4.1.beta.1 platform/wp7/RhoRubyLib/common/TimeInterval.cs