[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PATCH] Replacing (and removing) get_ticks_per_sec() func
From: |
rutuja shah |
Subject: |
Re: [Qemu-ppc] [PATCH] Replacing (and removing) get_ticks_per_sec() function with NANOSECONDS_PER_SECOND |
Date: |
Fri, 11 Mar 2016 13:02:28 +0530 |
NANOSECONDS_PER_SECOND is a macro while get_ticks_per_sec() is an
inline function. An inline function replaces a call to the function
with it's body. It is an indication to the compiler, which is then
upto the compiler to replace or not the inline definitions at compile
time. If it is not replaced, the function will be called everytime
through the stack mechanism. While macros are always expanded by the
preprocessor before compilation. As the functionality of both
get_ticks_per_sec() and NANOSECONDS_PER_SECOND is to give a constant
value, NANOSECONDS_PER_SECOND macro may prove out to be better at
performance.
Regards
Rutuja Shah
On Fri, Mar 11, 2016 at 2:50 AM, Programmingkid
<address@hidden> wrote:
> What advantage does NANOSECONDS_PER_SECOND have over get_ticks_per_sec()?