+inline wxTimeSpan::wxTimeSpan(long hours,
+ long minutes,
+ long seconds,
+ long milliseconds)
+{
+ // assign first to avoid precision loss
+ m_diff = hours;
+ m_diff *= 60l;
+ m_diff += minutes;
+ m_diff *= 60l;
+ m_diff += seconds;
+ m_diff *= 1000l;
+ m_diff += milliseconds;
+}
+
+// ----------------------------------------------------------------------------
+// wxTimeSpan accessors
+// ----------------------------------------------------------------------------
+
+inline wxLongLong wxTimeSpan::GetSeconds() const
+{
+ return m_diff / 1000l;
+}
+
+inline int wxTimeSpan::GetMinutes() const
+{
+ return (GetSeconds() / 60l).GetLo();
+}
+
+inline int wxTimeSpan::GetHours() const
+{
+ return GetMinutes() / 60;
+}
+
+inline int wxTimeSpan::GetDays() const
+{
+ return GetHours() / 24;
+}
+
+inline int wxTimeSpan::GetWeeks() const
+{
+ return GetDays() / 7;
+}
+
+// ----------------------------------------------------------------------------
+// wxTimeSpan arithmetics
+// ----------------------------------------------------------------------------
+
+inline wxTimeSpan wxTimeSpan::Add(const wxTimeSpan& diff) const
+{
+ return wxTimeSpan(m_diff + diff.GetValue());
+}
+
+inline wxTimeSpan& wxTimeSpan::Add(const wxTimeSpan& diff)