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