ulti.cpp

来自「处理机调度」· C++ 代码 · 共 29 行

CPP
29
字号
#include "Ulti.h"
#include <windows.h>
#include <stdlib.h>
#include <math.h>

		ULTI_TYPE eRandom(int upLimit)
		{
			ULTI_TYPE tmpData;
			do
			{
				tmpData=((ULTI_TYPE)rand()/(ULTI_TYPE)32767)*(ULTI_TYPE)100.0*(ULTI_TYPE)upLimit;
			}
			while(tmpData>upLimit);
	
			return tmpData;
		}
		
		void eDelay(int mSecs)
		{
			DWORD dwStart = GetTickCount();
			DWORD dwEnd = dwStart;
			int i;
			do
			{  
				  for(i=0;i<10000;i++)
				  	pow(2,3);
  				dwEnd = GetTickCount();  
			} while((dwEnd - dwStart)<=mSecs); 
		}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?