def humanDurationNanosec(nsec):
 if (nsec < 1000):
  return (u'%u nsec' % nsec)
 (usec, nsec) = divmod(nsec, 1000)
 if (usec < 1000):
  return (u'%.2f usec' % (usec + (float(nsec) / 1000)))
 (msec, usec) = divmod(usec, 1000)
 if (msec < 1000):
  return (u'%.2f ms' % (msec + (float(usec) / 1000)))
 return humanDuration(msec)

def humanDurationNanosec ( nsec ) : if ( nsec < 1000 ) : return ( u'%u nsec' % nsec ) ( usec , nsec ) = divmod ( nsec , 1000 ) if ( usec < 1000 ) : return ( u'%.2f usec' % ( usec + ( float ( nsec ) / 1000 ) ) ) ( msec , usec ) = divmod ( usec , 1000 ) if ( msec < 1000 ) : return ( u'%.2f ms' % ( msec + ( float ( usec ) / 1000 ) ) ) return humanDuration ( msec )
convert a duration in nanosecond to human natural representation .