/* function: nstime_to_sec converts nstime to double, time base is seconds  */
double nstime_to_sec(const nstime_t *nstime)
/* function: nstime_to_sec converts nstime to double, time base is seconds  */
double nstime_to_sec(const nstime_t *nstime)
{
    return ((double)nstime->secs + (double)nstime->nsecs/NS_PER_S);
}