📄 objtest.cpp
字号:
#include <bios.h>
#include <dos.h>
#include <stdlib.h>
#include <conio.h>
unsigned long counter = 0;
unsigned char tick = 18;
void interrupt (*old1ch)(...);
void interrupt new1ch (...)
{
tick --;
if (!tick)
{
tick = 18;
gotoxy (1, 1);
cprintf ("%lu objects/second", counter);
counter = 0;
}
}
void main ()
{
old1ch = getvect (0x1c);
setvect (0x1c, new1ch);
typedef unsigned long word32;
struct object
{
word32 identifier;
};
clrscr();
while (!bioskey(1))
{
object *o = new object;
delete o;
counter++;
}
bioskey(0);
setvect (0x1c, old1ch);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -