[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] How to get CPU time?



Hello!

You can for sure repeat the call of getloadavg and you get the uptodate load average of the last minute. top do exactly this.

Well, I will use the kern/stat, it's better for what I want to do.

Yes, that's why we introduced it. It simplify lot of things.

1) 'cpu' information from kern/stat gives me 4 long integers, what is the order? "user, nice, sys, idle" like linux or something else?

It should be like on Linux. If not it's a bug or it's missing. The idea was to simplify porting of Linux apps that use /proc. You just need to replace /proc with /kern (as already mentioned we couldn't use /proc as this was already in use under FreeMiNT; otherwise we had for sure choosen /proc :-)).

We also have some FreMiNT specific extension like the cookijar list, sysdir and such things. Ideas and improvements welcome.

2) This data are updated every second or faster( every 'clock tick')?

The data are updated if you read it :-)

MiNT is really a "strange" Unix system.. some stuffs are like in Linux and others like in BSD :)

Don't know what you mean. BSD and Linux are both Unix systems. They are compatible each other following the unix standards (they differ for sure in technical details, but that's not part of the standard).

FreeMiNT tries to be unix compatible as well (as best as we can; following the official standards (Unix98 for example)). And the use the best ideas (even BSD have a Linux compatible /proc (you only need to mount it)).


Regards,
Frank

--
ATARI FALCON 060 // MILAN 060
-----------------------------------------
http://www.cs.uni-magdeburg.de/~fnaumann/
e-Mail: fnaumann@freemint.de