㈠ 在c语言中,start=clock();是什么意思丫
start=clock(); -- start 存入现在(开始)时间(单位:时钟“嘀嗒”数)。
for (i=0;i<1000;i++) for (j=0;j<1000;j++) { };
end = clock() -- end 存入现在(结束)时间(单位:时钟“嘀嗒”数)。
end - start 得 用去时间:
dt = (end - start) / CLOCKS_PER_SEC; (单位:时钟秒数)。
别忘了 #include <time.h>
㈡ C语言中,busclock是什么意思
busclock 总线时钟
晶振频率是一个硬件器件的固有震荡频率。
晶振频率经过锁相环倍频,产生系统频率,这个也可以叫做系统时钟。
总线时钟嘛,就有可能是分频或倍频后的系统时钟。
这些看芯片的手册时钟的部分,都有图解的。
㈢ C语言时钟设计
#include<graphics.h> /* 引入graphic.h */ #include<math.h> /* 引入math.h */ #include<dos.h> /* 引入dos.h */ #define pi 3.1415926 /*定义pi=3.14159*/ #define X(a,b,c) x=a*cos(b*c*pi/180-pi/2)+300; #define Y(a,b,c) y=a*sin(b*c*pi/180-pi/2)+240; #define d(a,b,c) X(a,b,c);Y(a,b,c);line(300,240,x,y) /*定义……*/ void init() /*初始化程序*/ {int i,l,x1,x2,y1,y2; /*定义……*/ setbkcolor(1); /*设置颜色*/ circle(300,240,200); /*作园*/ circle(300,240,205); circle(300,240,5); for(i=0;i<60;i++) /*循环(算时间)*/ {if(i%5==0) l=15; else l=5; x1=200*cos(i*6*pi/180)+300; y1=200*sin(i*6*pi/180)+240; x2=(200-l)*cos(i*6*pi/180)+300; y2=(200-l)*sin(i*6*pi/180)+240; line(x1,y1,x2,y2); } } main() { int x,y; int gd=VGA,gm=2; unsigned char h,m,s; /*定义*/ struct time t[1]; initgraph(&gd,&gm,"d:\\tc"); init(); setwritemode(1); gettime(t); h=t[0].ti_hour; m=t[0].ti_min; s=t[0].ti_sec; /*定义时分秒*/ setcolor(7); /*设置颜色*/ d(150,h,30); setcolor(14); d(170,m,6); setcolor(4); d(190,s,6); while(!kbhit()) /*获取键盘相应*/ {while(t[0].ti_sec==s) gettime(t); /*C语言中得到时间的函数*/ sound(400); /*计算时间……*/ delay(70); sound(200); delay(30); nosound(); setcolor(4); d(190,s,6); s=t[0].ti_sec; d(190,s,6); if (t[0].ti_min!=m) { setcolor(14); d(170,m,6); m=t[0].ti_min; d(170,m,6); } if (t[0].ti_hour!=h) { setcolor(7); d(150,h,30); h=t[0].ti_hour; d(150,h,30); sound(1000); delay(240); nosound(); delay(140); sound(2000); delay(240); nosound(); } } getch(); /*设置空格后退出*/ closegraph(); }
㈣ 怎么用C语言编程数字时钟
1、以下例程实现时钟的实时显示基本要求: 1) 自行设计界面,模拟表盘式时钟。要求界面美观,清晰。2)数字同步显示时间信息。
2、例程:
#include<graphics.h>
#include<math.h>
#include<dos.h>
#definePI3.1415926
//屏幕中心的坐标(640X480模式下)
#definemid_x320
#definemid_y240
intmain()
{intgraphdriver=DETECT,graphmode;
intend_x,end_y;
structtimecurtime;
floatth_hour,th_min,th_sec;
initgraph(&graphdriver,&graphmode,"C:\TC2");//初始化VGA屏幕模式
setbkcolor(BLACK);//使用黑色的背景色
while(!kbhit(0))//若有键盘输入,则跳出,即是结束程序
{setcolor(GREEN);//把画笔设为绿色
circle(mid_x,mid_y,180);//钟的外圆
circle(mid_x,mid_y,150);//钟的内圆
circle(mid_x,mid_y,1);//画出钟的圆心
gettime(&curtime);//取得系统当前时间
th_sec=(float)curtime.ti_sec*0.1047197551;//把秒针的角度化为弧度,为以后绘制时方便,下同
th_min=(float)curtime.ti_min*0.1047197551+th_sec/60.0;//分针的弧度
th_hour=(float)curtime.ti_hour*0.5235987755+th_min/12.0;//时度的弧度,注意整时是12等分的,所时乘的是3.14/180*5
//计算出时针的尾的坐标(时针长70)
end_x=mid_x+70*sin(th_hour);
end_y=mid_y-70*cos(th_hour);
setcolor(RED);
line(mid_x,mid_y,end_x,end_y);//用红色线画出时针
//计算出分针坐标(分针长110)
end_x=mid_x+110*sin(th_min);
end_y=mid_y-110*cos(th_min);
setcolor(RED);
line(mid_x,mid_y,end_x,end_y);//用红色画出分针
end_x=mid_x+140*sin(th_sec);
end_y=mid_y-140*cos(th_sec);
setcolor(RED);
line(mid_x,mid_y,end_x,end_y);//同上,画出秒针,长为140
//画出钟盘上的刻度,刻度长20
line(140,240,160,240);//9点对应的大刻度
line(320,60,320,80);//12点对应的大刻度
line(500,240,480,240);//3点的刻度
line(320,420,320,400);//6点的刻度
line(410,395.7,400,378.4);//5点
line(475.7,330,458.4,320);//4点
line(475.7,150,458.4,160);//2点
line(410,84.3,400,101.6);//1点
line(230,84.3,240,101.6);//11点
line(164.3,150,181.6,160);//10点
line(164.3,330,181.6,320);//8点
line(230,395.7,240,378.4);//7点
sleep(BLUE);//这里应该是打错,停止一秒,应为sleep(1000)
cleardevice();//清除屏幕上的显示
}
closegraph();//关闭VGA屏幕,即返回文本方式
return0;
}
㈤ C语言的clock()测出来的是什么时间
clock函数返回的是cpu时间,并不是秒数,真正的一秒钟可能包含若干个CPU时间,这个值通常是由宏CLOCKS_PER_SEC来定义,表示一秒中有CLOCKS_PER_SEC这么多个cpu时间,不同的编译器可能不同,比如,linux C中,它是1000000,在VC6中,它是1000,你用cost除以CLOCKS_PER_SEC即可得到实际的秒数。
附linux下clock函数说明:
在单独的窗口中打开图片可以看得更清楚一些,注意红线部分说明:要计算秒数,除以CLOCKS_PER_SEC
㈥ c语言简单数学时钟(结构体,指针),求大佬帮助
至今为止,在中国历史上有留下记载的四代计时器分别为:日晷、沙漏、机械钟、石英钟。在中国市场上石英钟最热销。
时钟一直以来都是国人钟爱的商品之一。新中国成立以来,国家投入大量资金发展钟表工业,使这一产业得以快速发展,此后,中国的改革开放以及经济全球化发展给中国钟表业带来了繁荣。经过几十年的发展,中国钟表业经历了进料组装-外观件制造-产品开发-创立品牌的发展过程,目前已形成配套齐全的钟表制造工业,除高端机芯外的所有零配件均可加工生产。
现状
从区域格局来看,全国已形成以广州、深圳为龙头的珠三角地区、福建、浙江、江苏、山东、天津等6大钟表主产区;从产量来看,我国已成为世界钟表生产大国,钟表产量稳居世界第一。监测数据显示,2011年,我国钟和表的产量分别达到1.59亿只和1.3亿只。
我国钟表行业发展虽然取得长足的进步,但国内钟表企业及其品牌在国际市场上的信誉度和影响力还微不足道,产量占比虽然已经达到80%以上,但是产值占比不到30%,依然没有话语权和定价权。统计数据显示,2010年从金融危机阴影中走出来的中国钟表行业实现了全面的恢复和增长,全年规模以上企业工业总产值同比增长17.12%,销售收入同比增长23.00%,均达到2008年以来的最高增速,同时利润总额也大幅增长了55.63%。此外,我国钟表出口形势也得到好转,全年共实现出口额30.49亿美元,同比增长24.27%。
㈦ c语言中的时钟问题
#include"stdio.h"
#include"graphics.h"
#include"math.h"
#include"time.h"
#include"dos.h"
int point_sec,point_min,point_hour;
int x,y,z;
int array_sec[60][2];
int array_min[60][2];
int array_hour[60][2];
int a[60][2];
void zhongmian()
{
int n,m,p;
x=320;
y=240;
z=140;
point_sec=132;
point_min=110;
point_hour=90;
setfillstyle(1,2);
setlinestyle(0,0,3);
ellipse(x,y,0,180,220,150);
setlinestyle(0,0,3);
ellipse(x,y,180,360,220,150);
ellipse(x,y,90,270,210,150);
ellipse(x,y,90,270,200,150);
ellipse(x,y,90,270,190,150);
ellipse(x,y,90,270,180,150);
ellipse(x,y,90,270,170,150);
ellipse(x,y,90,270,160,150);
ellipse(x,y,90,270,150,150);
ellipse(x,y,270,90,150,150);
ellipse(x,y,270,90,160,150);
ellipse(x,y,270,90,170,150);
ellipse(x,y,270,90,180,150);
ellipse(x,y,270,90,190,150);
ellipse(x,y,270,90,200,150);
ellipse(x,y,270,90,210,150);
setcolor(3);
ellipse(x,80,25,155,72,72);
ellipse(x,80,40,140,55,55);
setcolor(RED);
circle(x,y,148);
floodfill(165,240,RED);
floodfill(145,240,RED);
floodfill(125,240,RED);
floodfill(105,240,RED);
floodfill(475,240,RED);
floodfill(495,240,RED);
floodfill(515,240,RED);
floodfill(535,240,RED);
setlinestyle(0,0,3);
line(135,320,90,420);
line(505,320,550,420);
line(90,420,550,420);
arc(x,y,26,154,200);
setcolor(YELLOW);
arc(x,y,32,147,192);
setcolor(YELLOW);
setfillstyle(1,1);
floodfill(250,400,RED);
putpixel(320,100,YELLOW);
fillellipse(320,100,5,5);
putpixel(390,119,YELLOW);
fillellipse(390,119,5,5);
putpixel(441,170,YELLOW);
fillellipse(441,170,5,5);
putpixel(460,240,YELLOW);
fillellipse(460,240,5,5);
putpixel(441,310,YELLOW);
fillellipse(441,310,5,5);
putpixel(390,361,YELLOW);
fillellipse(390,361,5,5);
putpixel(320,380,YELLOW);
fillellipse(320,380,5,5);
putpixel(250,361,YELLOW);
fillellipse(250,361,5,5);;
putpixel(199,310,YELLOW);
fillellipse(199,310,5,5);
putpixel(180,240,YELLOW);
fillellipse(180,240,5,5);;
putpixel(199,170,YELLOW);
fillellipse(199,170,5,5);;
putpixel(250,119,YELLOW);
fillellipse(250,119,5,5);;
for(p=6,n=0,m=0;n<15;p=p+6,n++,m++){
a[m][0]=(int)(x+z*sin(2*3.14*p/360));
a[m][1]=(int)(y-z*cos(2*3.14*p/360));
array_sec[m][0]=(int)(x+point_sec*sin(2*3.14*p/360));
array_sec[m][1]=(int)(y-point_sec*cos(2*3.14*p/360));
array_min[m][0]=(int)(x+point_min*sin(2*3.14*p/360));
array_min[m][1]=(int)(y-point_min*cos(2*3.14*p/360));
array_hour[m][0]=(int)(x+point_hour*sin(2*3.14*p/360));
array_hour[m][1]=(int)(y-point_hour*cos(2*3.14*p/360));
}
for(p=6,n=0;n<15;p=p+6,n++,m++){
a[m][0]=(int)(x+z*cos(2*3.14*p/360));
a[m][1]=(int)(y+z*sin(2*3.14*p/360));
array_sec[m][0]=(int)(x+point_sec*cos(2*3.14*p/360));
array_sec[m][1]=(int)(y+point_sec*sin(2*3.14*p/360));
array_min[m][0]=(int)(x+point_min*cos(2*3.14*p/360));
array_min[m][1]=(int)(y+point_min*sin(2*3.14*p/360));
array_hour[m][0]=(int)(x+point_hour*cos(2*3.14*p/360));
array_hour[m][1]=(int)(y+point_hour*sin(2*3.14*p/360));
}
for(p=6,n=0;n<15;p=p+6,n++,m++){
a[m][0]=(int)(x-z*sin(2*3.14*p/360));
a[m][1]=(int)(y+z*cos(2*3.14*p/360));
array_sec[m][0]=(int)(x-point_sec*sin(2*3.14*p/360));
array_sec[m][1]=(int)(y+point_sec*cos(2*3.14*p/360));
array_min[m][0]=(int)(x-point_min*sin(2*3.14*p/360));
array_min[m][1]=(int)(y+point_min*cos(2*3.14*p/360));
array_hour[m][0]=(int)(x-point_hour*sin(2*3.14*p/360));
array_hour[m][1]=(int)(y+point_hour*cos(2*3.14*p/360));
}
for(p=6,n=0;n<15;p=p+6,n++,m++){
a[m][0]=(int)(x-z*cos(2*3.14*p/360));
a[m][1]=(int)(y-z*sin(2*3.14*p/360));
array_sec[m][0]=(int)(x-point_sec*cos(2*3.14*p/360));
array_sec[m][1]=(int)(y-point_sec*sin(2*3.14*p/360));
array_min[m][0]=(int)(x-point_min*cos(2*3.14*p/360));
array_min[m][1]=(int)(y-point_min*sin(2*3.14*p/360));
array_hour[m][0]=(int)(x-point_hour*cos(2*3.14*p/360));
array_hour[m][1]=(int)(y-point_hour*sin(2*3.14*p/360));
}
for(n=0;n<60;n++)
putpixel(a[n][0],a[n][1],YELLOW);
}
void zhuandong()
{
struct tm * p;
time_t l;
int n,m,i,q,b,c,sec,min,hour;
n=61;
m=61;
i=61;
b=0;
c=0;
while(1){
l=time(NULL);
p=localtime(&l);
sec=p->tm_sec;
min=p->tm_min;
hour=p->tm_hour;
gotoxy(29,12);
if(n==sec){
setcolor(0);
setlinestyle(0,0,1);
line(x,y,array_sec[(sec+58)%60][0],array_sec[(sec+58)%60][1]);
setlinestyle(0,0,2);
line(x,y,array_min[(min+58)%60][0],array_min[(min+58)%60][1]);
setlinestyle(0,0,3);
line(x,y,array_hour[(hour%12*5+min/12+58)%60][0],array_hour[(hour%12*5+min/12+58)%60][1]);
setcolor(YELLOW);
setlinestyle(0,0,3);
line(x,y,array_hour[(hour%12*5+min/12+59)%60][0],array_hour[(hour%12*5+min/12+59)%60][1]);
setlinestyle(0,0,2);
line(x,y,array_min[(min+59)%60][0],array_min[(min+59)%60][1]);
printf("%s",asctime(p));
sound(50);
delay(100);
nosound();
setcolor(YELLOW);
setlinestyle(0,0,1);
line(320,240,array_sec[(sec+59)%60][0],array_sec[(sec+59)%60][1]);
}
n=sec+1;
if(n==60)n=0;
if(b==0)
{m=min;b=1;}
if(min==m){
setcolor(0);
setcolor(YELLOW);
setlinestyle(0,0,3);
line(x,y,array_hour[(hour%12*5+min/12+59)%60][0],array_hour[(hour%12*5+min/12+59)%60][1]);
setlinestyle(0,0,2);
line(x,y,array_min[(min+59)%60][0],array_min[(min+59)%60][1]);
}
m=min+1;
if(m==60)m=0;
if(c==0)
{i=min;c=1;}
if(i==min){
setcolor(0);
setcolor(YELLOW);
setlinestyle(0,0,3);
line(x,y,array_hour[(hour%12*5+min/12+59)%60][0],array_hour[(hour%12*5+min/12+59)%60][1]);
}
i=min+1;
if(i==60)i=0;
if(kbhit())exit(1);
}
}
main()
{
int gdriver,mode;
gdriver=VGA;
mode=VGAHI;
registerbgidriver(EGAVGA_driver);
initgraph(&gdriver,&mode,"");
setbkcolor(0);
setcolor(RED);
zhongmian();
zhuandong();
closegraph();
}
㈧ c语言怎么样编写一个时钟程序
c语言时钟程序代码如下:
#include<windows.h>
#include<math.h>
#define ID_TIMER 1//计时器ID
#define TWOPI (2*3.14159)
LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR szCmdLine,int iCmdShow)
{
static TCHAR szAppName[]=TEXT("Clock");
HWND hwnd;
MSG msg;
WNDCLASS wndclass;
wndclass.cbClsExtra=0;
wndclass.cbWndExtra=0;
wndclass.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
wndclass.hCursor=LoadCursor(NULL,IDC_ARROW);
wndclass.hIcon=LoadIcon(NULL,IDI_APPLICATION);
wndclass.hInstance=hInstance;
wndclass.lpfnWndProc=WndProc;
wndclass.lpszClassName=szAppName;
wndclass.lpszMenuName=NULL;
wndclass.style=CS_HREDRAW|CS_VREDRAW;
if(!RegisterClass(&wndclass))
{
MessageBox(NULL,TEXT("This program requires Windows
T"),szAppName,MB_ICONERROR);
return 0;
}
hwnd=CreateWindow(szAppName,TEXT("Analog Clock"),WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,NULL,NULL,hInstance,NULL);
ShowWindow(hwnd,iCmdShow);
UpdateWindow(hwnd);
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
void Setsotropic(HDC hdc,int cxClient,int cyClient)
{
SetMapMode(hdc,MM_ISOTROPIC);
SetWindowExtEx(hdc,1000,1000,NULL);
SetViewportExtEx(hdc,cxClient/2,-cyClient/2,NULL);
SetViewportOrgEx(hdc,cxClient/2,cyClient/2,NULL);
}
void RotatePoint(POINT pt[],int iNum,int iAngle)
{
int i;
POINT ptTemp;
for(i=0;i<iNum;i++)
{
ptTemp.x=(int)(pt[i].x*cos(TWOPI*iAngle/360)+pt[i].y*sin(TWOPI*iAngle/360));
ptTemp.y=(int)(pt[i].y*cos(TWOPI*iAngle/360)+pt[i].x*sin(TWOPI*iAngle/360));
pt[i]=ptTemp;
}
}
void DrawClock(HDC hdc)
{
int iAngle;
POINT pt[3];
for(iAngle=0;iAngle<360;iAngle+=6)
{
pt[0].x=0;
pt[0].y=900;
RotatePoint(pt,1,iAngle);
pt[2].x=pt[2].y=iAngle%5?33:100;
pt[0].x-=pt[2].x/2;
pt[0].y-=pt[2].y/2;
pt[1].x=pt[0].x+pt[2].x;
pt[1].y=pt[0].y+pt[2].y;
SelectObject(hdc,GetStockObject(BLACK_BRUSH));
Ellipse(hdc,pt[0].x,pt[0].y,pt[1].x,pt[1].y );
}
}
void DrawHands(HDC hdc,SYSTEMTIME *pst,BOOL fChange)
{
static POINT pt[3][5]={0,-150,100,0,0,600,-100,0,0,-150, 0,-200,50,0,0,800,-50,0,0,-200, 0,0,0,0,0,0,0,0,0,800 };
int i,iAngle[3];
POINT ptTemp[3][5];
iAngle[0]=(pst->wHour*30)%360+pst->wMinute/2;
iAngle[1]=pst->wMinute*6;
iAngle[2]=pst->wSecond*6;
memcpy(ptTemp,pt,sizeof(pt));
for(i=fChange?0:2;i<3;i++)
{
RotatePoint(ptTemp[i],5,iAngle[i]);
Polyline(hdc,ptTemp[i],5);
}
}
LRESULT CALLBACK WndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam)
{
static int cxClient,cyClient;
static SYSTEMTIME stPrevious;
BOOL fChange;
HDC hdc;
PAINTSTRUCT ps;
SYSTEMTIME st;
switch(message)
{
case WM_CREATE:
SetTimer(hwnd,ID_TIMER,1000,NULL);
GetLocalTime(&st);
stPrevious=st;
return 0;
case WM_SIZE:
cxClient=LOWORD(lParam);
cyClient=HIWORD(lParam);
return 0;
case WM_TIMER:
GetLocalTime(&st);
fChange=st.wHour!=stPrevious.wHour||st.wMinute!=stPrevious.wMinute;
hdc=GetDC(hwnd);
Setsotropic(hdc,cxClient,cyClient);
SelectObject(hdc,GetStockObject(WHITE_PEN));
DrawHands(hdc,&stPrevious,fChange);
SelectObject(hdc,GetStockObject(BLACK_PEN));
DrawHands(hdc,&st,TRUE);
stPrevious=st;
return 0;
case WM_PAINT:
hdc=BeginPaint(hwnd,&ps);
Setsotropic(hdc,cxClient,cyClient);
DrawClock(hdc);
DrawHands(hdc,&stPrevious,TRUE);
EndPaint(hwnd,&ps);
return 0;
case WM_DESTROY:
KillTimer(hwnd,ID_TIMER);
PostQuitMessage(0);
return 0;
}
return DefWindowProc(hwnd,message,wParam,lParam);
}
㈨ c语言时钟代码
#include<graphics.h> /* 引入graphic.h */
#include<math.h> /* 引入math.h */
#include<dos.h> /* 引入dos.h */
#define pi 3.1415926 /*定义pi=3.14159*/
#define X(a,b,c) x=a*cos(b*c*pi/180-pi/2)+300;
#define Y(a,b,c) y=a*sin(b*c*pi/180-pi/2)+240;
#define d(a,b,c) X(a,b,c);Y(a,b,c);line(300,240,x,y) /*定义……*/
void init() /*初始化程序*/
{int i,l,x1,x2,y1,y2; /*定义……*/
setbkcolor(1); /*设置颜色*/
circle(300,240,200); /*作园*/
circle(300,240,205);
circle(300,240,5);
for(i=0;i<60;i++) /*循环(算时间)*/
{if(i%5==0) l=15;
else l=5;
x1=200*cos(i*6*pi/180)+300;
y1=200*sin(i*6*pi/180)+240;
x2=(200-l)*cos(i*6*pi/180)+300;
y2=(200-l)*sin(i*6*pi/180)+240;
line(x1,y1,x2,y2);
}
}
main()
{
int x,y;
int gd=VGA,gm=2;
unsigned char h,m,s; /*定义*/
struct time t[1];
initgraph(&gd,&gm,"d:\\tc");
init();
setwritemode(1);
gettime(t);
h=t[0].ti_hour;
m=t[0].ti_min;
s=t[0].ti_sec; /*定义时分秒*/
setcolor(7); /*设置颜色*/
d(150,h,30);
setcolor(14);
d(170,m,6);
setcolor(4);
d(190,s,6);
while(!kbhit()) /*获取键盘相应*/
{while(t[0].ti_sec==s)
gettime(t); /*C语言中得到时间的函数*/
sound(400); /*计算时间……*/
delay(70);
sound(200);
delay(30);
nosound();
setcolor(4);
d(190,s,6);
s=t[0].ti_sec;
d(190,s,6);
if (t[0].ti_min!=m)
{
setcolor(14);
d(170,m,6);
m=t[0].ti_min;
d(170,m,6);
}
if (t[0].ti_hour!=h)
{ setcolor(7);
d(150,h,30);
h=t[0].ti_hour;
d(150,h,30);
sound(1000);
delay(240);
nosound();
delay(140);
sound(2000);
delay(240);
nosound();
}
}
getch(); /*设置空格后退出*/
closegraph();
}
具体的。。就是套用用几个函数算时间。。
不要对这种很长的东西害怕,其实大部分都是在画这个钟~
加油哦~
㈩ c语言中pllclock什么意思
pllclock 不是c语言保留字,也不是标准函数名,应当是自定义 变量名或函数名。
pllclock 顾名思义 ,是 锁相环时钟 -- “PLL时钟” 的意思。
锁相环(PLL: Phase-locked loops)是一种利用反馈控制原理实现的频率及相位的同步技术,其作用是将电路输出的时钟与其外部的参考时钟保持同步。当参考时钟的频率或相位发生改变时,锁相环会检测到这种变化,并且通过其内部的反馈系统来调节输出频率,直到两者重新同步,这种同步又称为“锁相”(Phase-locked)。详细知识,可以在网上查找。