It appears that your browser does not comply with the W3C web standards which define how web pages are encoded, transmitted, and rendered. This site would look much better in a standards-compliant web browser, but its content is accessible to any browser or Internet device.
License : LGPL
/****************************************************************************** * CPU Speed * --------- * Author: Alan Doyle (alan.doyle@darkbyte.com) * Copyright: (c) 2005 Darkbyte Software * Release Version: 1.0 * Date Started: 2005/08/03 * * Display the current CPU Speed in MHz ( Pentium class PC's or higher ). * Tested under Linux, Windows 2000 and Windows XP. * ****************************************************************************** * * cpu.c is free software; you can redistribute it and/or modify * it under the terms of the Lesser General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * cpu.c is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the Lesser General Public License * along with cpu.c; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ******************************************************************************/ #include <stdio.h> #ifdef WIN32 #include <windows.h> #define rdtsc(low, high) \ __asm \ { \ __asm _emit 0x0f \ __asm _emit 0x31 \ __asm mov high,edx \ __asm mov low,eax \ } void usleep( unsigned long delay ) { Sleep( delay / 1000 ); } #else #define rdtsc(low,high) \ __asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high)) #endif int main( void ) { unsigned long startlow, starthigh; unsigned long endlow, endhigh; unsigned long delay = 500; rdtsc(startlow,starthigh); usleep( delay * 1000 ); rdtsc(endlow,endhigh); printf("CPU Speed : %d MHz\n", ( ( endlow - startlow ) / ( 1000 * delay ) ) ); return 0; }