Logo Search packages:      
Sourcecode: libnl version File versions  Download package

double nl_cancel_down_us ( uint32_t  l,
char **  unit 
)

Cancel down a micro second value

  • l micro seconds
  • unit destination unit pointer
Cancels down a microsecond counter until it reaches a reasonable unit. The chosen unit is assigned to unit.

Returns:
The cancelled down microsecond in the new unit

Definition at line 163 of file utils.c.

{
      if (l >= 1000000) {
            *unit = "s";
            return ((double) l) / 1000000;
      } else if (l >= 1000) {
            *unit = "ms";
            return ((double) l) / 1000;
      } else {
            *unit = "us";
            return (double) l;
      }
}


Generated by  Doxygen 1.6.0   Back to index