::: µ¨ÆÄÀÌ Tip&Trick :::

µ¨ÆÄÀÌ Tip&Trick ¼º°Ý¿¡ ¸ÂÁö ¾Ê´Â ±¤°í,ºñ¹æ,Áú¹®ÀÇ ±ÛÀº Áï½Ã »èÁ¦Çϸç
³»¿ëÀ» º¹»çÇÏ¿© »ç¿ëÇÒ °æ¿ì ¹Ýµå½Ã ÀÌ°÷(http://www.howto.pe.kr)À» Ãâó·Î ¸í½ÃÇÏ¿© ÁÖ¼¼¿ä


Category

  ±è¿µ´ë(2003-03-07 20:15:28, Hit : 4555, Vote : 1233
 CPU speed ±¸Çϱâ 2

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ExtCtrls, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Label1: TLabel;
    Timer1: TTimer;
    procedure Button1Click(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation
{$R *.DFM}

function GetCpuSpeed: Comp;
{ function to return the CPU clock speed only.                                     }
{ Usage: MessageDlg(Format('%.1f MHz', [GetCpuSpeed]), mtConfirmation, [mbOk], 0); }
var
  t: DWORD;
  mhi, mlo, nhi, nlo: DWORD;
  t0, t1, chi, clo, shr32: Comp;
begin
  shr32 := 65536;
  shr32 := shr32 * 65536;

  t := GetTickCount;
  while t = GetTickCount do begin end;
  asm
    DB 0FH
    DB 031H
    mov mhi,edx
    mov mlo,eax
  end;

  while GetTickCount < (t + 1000) do begin end;
  asm
    DB 0FH
    DB 031H
    mov nhi,edx
    mov nlo,eax
  end;

  chi := mhi;
  if mhi < 0 then chi := chi + shr32;

  clo := mlo;
  if mlo < 0 then clo := clo + shr32;

  t0 := chi * shr32 + clo;

  chi := nhi;
  if nhi < 0 then chi := chi + shr32;

  clo := nlo;
  if nlo < 0 then clo := clo + shr32;

  t1 := chi * shr32 + clo;

  Result := (t1 - t0) / 1E6;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  Timer1.Enabled := True;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  Timer1.Enabled := False;
  Label1.Caption := Format('%.1f MHz', [GetCpuSpeed]);
  Timer1.Enabled := True;
end;

end.





291   [µ¥ÀÌÅͺ£À̽º] µ¥ÀÌÅÍ ¼¼Æ®(data set)ÀÇ DisableControls  ±è¿µ´ë 2003/03/05 5294 1240
290   [À©µµ¿ìÁî API] IEÀÇ ÇöÀç url °¡Á®¿À±â  ±è¿µ´ë 2003/03/07 5064 1239
289   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] StringGrid ¸¦ ÅؽºÆ®ÆÄÀÏ(csv)·Î ÀúÀåÇÏ°í ºÒ·¯¿À±â  ±è¿µ´ë 2004/09/11 5814 1238
288   [½Ã½ºÅÛ] PC¿¡ ¼³Ä¡µÈ µå¶óÀÌºê ¸ñ·Ï ±¸ÇÏ±â  ±è¿µ´ë 2003/03/07 5205 1238
287   [½Ã½ºÅÛ] ÇÁ¸°ÅÍÀÇ ´ë±â¹®¼­,µî·ÏÁ¤º¸,Ãß°¡ ¸¶¹ý»ç È£ÃâÇÏ±â  ±è¿µ´ë 2003/03/05 4797 1238
286   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] ¸ðµç µå¶óÀ̺ê,µð·ºÅ丮 °Ë»öÇÏ¿© ÆÄÀÏ Ã£±â  ±è¿µ´ë 2003/03/07 5110 1237
285   [À©µµ¿ìÁî API] ¾îÇø®ÄÉÀ̼ÇÀÇ Áߺ¹½ÇÇà ¹æÁö  ±è¿µ´ë 2003/03/05 5169 1237
284   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] ¹®ÀÚ¿­ÀÇ word °¹¼ö ¼¼±â  ±è¿µ´ë 2003/03/04 4633 1237
283   [À©µµ¿ìÁî API] ¹Ù·Î Á÷Àü¿¡ active µÇ¾ú´ø À©µµ¿ì¿Í ÄÜÆ®·Ñ ±¸ÇÏ±â  ±è¿µ´ë 2004/07/24 5051 1236
282   [½Ã½ºÅÛ] À©µµ¿ìÁî Àç½ÃÀÛ  ±è¿µ´ë 2004/08/30 4929 1235
281   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] ÄÄÆ÷³ÍÆ®¿¡ µ¿ÀûÀ¸·Î À̺¥Æ® ÇÒ´çÇÏ±â  ±è¿µ´ë 2004/10/08 5518 1234
280   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] ¸ð¼­¸®°¡ µÕ±Ù(rounded ends) TMemo ¸¸µé±â  ±è¿µ´ë 2004/07/25 4995 1234
279   [³×Æ®¿÷/ÀÎÅͳÝ] ³×Æ®¿öÅ©ÀÇ ÄÄÇ»ÅÍ À̸§,ÀÛ¾÷ ±×·ì,ÄÄÇ»ÅÍ ¼³¸í  ±è¿µ´ë 2003/03/06 5589 1234
278   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] URL encoding ÇÏ±â  ±è¿µ´ë 2003/03/30 4872 1233
  [½Ã½ºÅÛ] CPU speed ±¸Çϱâ 2  ±è¿µ´ë 2003/03/07 4555 1233
276   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] º£Áê(Bezier) °î¼± ±×¸®±â2  ±è¿µ´ë 2003/03/07 6478 1232
275   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] ŸÀÌƲ¹Ù Ŭ¸¯½Ã »ç¿ëÀÚ Æ˾÷¸Þ´º º¸ÀÌ±â  ±è¿µ´ë 2003/03/07 5204 1232
274   [À©µµ¿ìÁî API] "¹®¼­" ¸Þ´º¿¡ ÆÄÀÏÀ» µî·ÏÇÏ°í »èÁ¦ÇÏ±â  ±è¿µ´ë 2003/03/05 4736 1232
273   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] TEdit ÀÔ·ÂÀÌ ÃÖ´ë ±æÀ̸¦ ¹ù¾î³ª¸é focus À̵¿  ±è¿µ´ë 2003/03/07 4782 1230
272   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] StringGrid ÀÇ BeginUpdate/EndUpdate ?  ±è¿µ´ë 2003/03/07 6006 1229
271   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] ListView ÀÇ Ä÷³º°·Î Sort (³»¸²Â÷¼ø Æ÷ÇÔ)  ±è¿µ´ë 2003/03/05 5908 1229
270   [À©µµ¿ìÁî API] À©µµ¿ìÁîÀÇ ½Ã½ºÅÛ Æú´õµéÀÇ ½ÇÁ¦ µð·ºÅ丮  ±è¿µ´ë 2003/03/05 4653 1229
269   [À©µµ¿ìÁî API] TreeView¿¡ Data »ç¿ë¹ý  ½ÅÈÆÀç 2003/03/10 5348 1228
268   [µ¥ÀÌÅͺ£À̽º] ¸î°¡Áö BDE ȯ°æÁ¤º¸ ±¸ÇÏ±â  ±è¿µ´ë 2003/03/07 4744 1228
267   [½Ã½ºÅÛ] HintÀÇ ÆùÆ® ¹Ù²Ù±â  ±è¿µ´ë 2003/03/05 4449 1228
266   [¾Ë°í¸®Áò] µÎ ¹®ÀÚ¿­ÀÇ À¯»çµµ °Ë»çÇÏ±â  ±è¿µ´ë 2004/09/04 5554 1227
265   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] TPanel ·Î ¸¸µç ÈùÆ®  ±è¿µ´ë 2004/08/05 4885 1227
264   [¾Ë°í¸®Áò] String Hash ÇÔ¼ö  ±è¿µ´ë 2004/09/17 4813 1226
263   [À©µµ¿ìÁî API] µ¥½ºÅ©Å¾ ¾ÆÀÌÄÜ ÀüºÎ °¨Ãß±â/º¸ÀÌ±â  ±è¿µ´ë 2003/03/07 4274 1226
262   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] ·¹Áö½ºÆ®¸®ÀÇ "(±âº»°ª)" ¿¡ Àаí/¾²±â  ±è¿µ´ë 2003/03/07 4312 1225
261   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] TList ¸¦ ÀÌ¿ëÇÑ stack ±¸Á¶ ±¸Çö  ±è¿µ´ë 2004/07/25 4687 1224
260   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] ListBoxÀÇ È­¸é¿¡ º¸¿©Áö´Â ÃÖ»óÀ§ Item ¹øÈ£  ±è¿µ´ë 2003/03/07 4661 1224
259   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] ¹®ÀÚ¿­ÀÇ ³¡¿¡¼­ºÎÅÍ °Ë»öÇÏ´Â Pos() ÇÔ¼ö  ±è¿µ´ë 2003/03/07 5405 1224
258   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] ¼öÁ÷ ½ºÅ©·ÑÀÌ ¸Ç¸¶Áö¸·À¸·Î À̵¿Çß´ÂÁö °Ë»ç  ±è¿µ´ë 2003/03/07 4203 1223
257   [½Ã½ºÅÛ] Thread »ç¿ëÇÏ±â  ±è¿µ´ë 2003/03/07 4577 1223
256   [COM/OLE] How to register an OCX  ±è¿µ´ë 2003/03/06 5407 1222
255     [COM/OLE] [re] PDF ActiveX »ç¿ëÇÏ±â  Ãʺ¸µ¨ÇÇ 2005/07/18 5734 1221
254   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] TListView Subcolumn Sorting  ±è¿µ´ë 2003/03/06 4867 1221
253   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] TStringGrid ÀμâÇÏ±â  ±è¿µ´ë 2003/03/07 5089 1219
252   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] StringGridÀÇ ¸ðµç Cell ¼±ÅÃ/ÇØÁ¦ÇÏ±â  ±è¿µ´ë 2004/09/25 5165 1218

[ÀÌÀü 10°³] [1]..[11][12][13][14][15][16][17] 18 [19][20]..[25] [´ÙÀ½ 10°³]
 

Copyright 1999-2024 Zeroboard / skin by zero