mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
armv6/legacy: optimize cpu_getcount performance
Use nanotime instread of binuptime. This change is for old and legacy platforms and does not impact any armv7 and later. Might be MFCed to 13.0 once armv6 support is finally dropped in 14.0 Sponsored by: Stormshield Reviewed by: mw Obtained from: Semihalf Differential revision: https://reviews.freebsd.org/D33719
This commit is contained in:
parent
1d33307434
commit
25bcd81b8d
1 changed files with 4 additions and 4 deletions
|
|
@ -40,11 +40,11 @@ get_cyclecount(void)
|
|||
} else
|
||||
#endif
|
||||
return cp15_pmccntr_get();
|
||||
#else /* No performance counters, so use binuptime(9). This is slooooow */
|
||||
struct bintime bt;
|
||||
#else /* No performance counters, so use nanotime(9). */
|
||||
struct timespec tv;
|
||||
|
||||
binuptime(&bt);
|
||||
return ((uint64_t)bt.sec << 56 | bt.frac >> 8);
|
||||
nanotime(&tv);
|
||||
return (tv.tv_sec * (uint64_t)1000000000ull + tv.tv_nsec);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue