Loading...
Searching...
No Matches
units.h File Reference

Unit helper macros. More...

Detailed Description

Unit helper macros.

Author
Benjamin Valentin benja.nosp@m.min..nosp@m.valen.nosp@m.tin@.nosp@m.ml-pa.nosp@m..com

Definition in file units.h.

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

#define KiB(x)   ((unsigned long)(x) << 10)
 A macro to return the bytes in x KiB.
 
#define MiB(x)   (KiB(x) << 10)
 A macro to return the bytes in x MiB.
 
#define GiB(x)   ((unsigned long long)MiB(x) << 10)
 A macro to return the bytes in x GiB.
 
#define KHZ(x)   ((x) * 1000UL)
 A macro to return the Hz in x kHz.
 
#define MHZ(x)   (KHZ(x) * 1000UL)
 A macro to return the Hz in x MHz.
 
#define GHZ(x)   (MHZ(x) * 1000ULL)
 A macro to return the Hz in x GHz.
 

Macro Definition Documentation

◆ GHZ

#define GHZ (   x)    (MHZ(x) * 1000ULL)

A macro to return the Hz in x GHz.

Definition at line 54 of file units.h.

◆ GiB

#define GiB (   x)    ((unsigned long long)MiB(x) << 10)

A macro to return the bytes in x GiB.

Definition at line 39 of file units.h.

◆ KHZ

#define KHZ (   x)    ((x) * 1000UL)

A macro to return the Hz in x kHz.

Definition at line 44 of file units.h.

◆ KiB

#define KiB (   x)    ((unsigned long)(x) << 10)

A macro to return the bytes in x KiB.

Definition at line 29 of file units.h.

◆ MHZ

#define MHZ (   x)    (KHZ(x) * 1000UL)

A macro to return the Hz in x MHz.

Definition at line 49 of file units.h.

◆ MiB

#define MiB (   x)    (KiB(x) << 10)

A macro to return the bytes in x MiB.

Definition at line 34 of file units.h.