CPU speed

I need a function that returns the clock of a CPU - if
possible both for normal Pentium and Pentium 2.
Please use Pascal, assembly only if really needed.