Well, if you insist on using top, double-check the man page. I found this in mine (shipped with GNU procps-3.2.7-8.1.el5):
Quote:
7. BUGS
Send bug reports to:
Albert D. Cahalan, <albert@users.sf.net>
The top command calculates Cpu(s) by looking at the change in CPU time values between samples. When
you first run it, it has no previous sample to compare to, so these initial values are the percent-
ages since boot. It means you need at least two loops or you have to ignore summary output from the
first loop. This is problem for example for batch mode. There is a possible workaround if you define
the CPULOOP=1 environment variable. The top command will be run one extra hidden loop for CPU data
before standard output.
Plus, rather than incur an even heavier load by invoking top, you could do as top does to get it's information; in my case it reads /proc/stat to get the CPU counters. Since you didn't reply with your OS, I don't know if this will work for you.
BTW, I'm not sure if you mean RTOS, but if you really need this to be real-time, I'd definitely minimize the impact of monitoring as much as possible.