/* Subtracts t1 from t2 and assigns the difference (positive or negative) to timespan.  */
err_t timespanDifference(timespan_t *t1, timespan_t *t2, timespan_t *timespan)
/* Subtracts t1 from t2 and assigns the difference (positive or negative) to timespan.  */
err_t timespanDifference(timespan_t *t1, timespan_t *t2, timespan_t *timespan)
{
  if ((t1 == NULL) || (t2 == NULL) || (timespan == NULL))
  {
    return ERROR_INVALIDPARAMETER;
  }
  return timespanCreate(t2->__ticks - t1->__ticks, timespan);
}