def nsecs_to_timeval(ns):
 ns = int(ns)
 return ((ns / (10 ** 9)), ((ns % (10 ** 9)) / 1000))

def nsecs_to_timeval ( ns ) : ns = int ( ns ) return ( ( ns / ( 10 ** 9 ) ) , ( ( ns % ( 10 ** 9 ) ) / 1000 ) )
return where ns is always non-negative and t = s + us / 10e5 .