*: introduce and use FAST_FUNC: regparm on i386, otherwise no-on
text data bss dec hex filename 808035 611 6868 815514 c719a busybox_old 804472 611 6868 811951 c63af busybox_unstripped
This commit is contained in:
@@ -20,14 +20,14 @@
|
||||
|
||||
/* libc has incredibly messy way of doing this,
|
||||
* typically requiring -lrt. We just skip all this mess */
|
||||
unsigned long long monotonic_us(void)
|
||||
unsigned long long FAST_FUNC monotonic_us(void)
|
||||
{
|
||||
struct timespec ts;
|
||||
if (syscall(__NR_clock_gettime, CLOCK_MONOTONIC, &ts))
|
||||
bb_error_msg_and_die("clock_gettime(MONOTONIC) failed");
|
||||
return ts.tv_sec * 1000000ULL + ts.tv_nsec/1000;
|
||||
}
|
||||
unsigned monotonic_sec(void)
|
||||
unsigned FAST_FUNC monotonic_sec(void)
|
||||
{
|
||||
struct timespec ts;
|
||||
if (syscall(__NR_clock_gettime, CLOCK_MONOTONIC, &ts))
|
||||
@@ -35,14 +35,14 @@ unsigned monotonic_sec(void)
|
||||
return ts.tv_sec;
|
||||
}
|
||||
#else
|
||||
unsigned long long monotonic_us(void)
|
||||
unsigned long long FAST_FUNC monotonic_us(void)
|
||||
{
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
return tv.tv_sec * 1000000ULL + tv.tv_usec;
|
||||
}
|
||||
|
||||
unsigned monotonic_sec(void)
|
||||
unsigned FAST_FUNC monotonic_sec(void)
|
||||
{
|
||||
return time(NULL);
|
||||
}
|
||||
|
Reference in New Issue
Block a user