mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 13:37:12 +00:00
This is really a bare bones counter. It works with the last build.
Not really useful, but lets you watch ROS working for hours. Counters slow down dramatically (486/66) when many instances are running (3+). Also a subtle CSR console support bug appears: when you switch console, if the restored one wrote below the bottom line, current Y is not the bottom line anymore. svn path=/trunk/; revision=1737
This commit is contained in:
parent
8c86bcfe89
commit
988ec8cb30
3 changed files with 70 additions and 5 deletions
|
@ -1,11 +1,11 @@
|
||||||
/* $Id: alive.c,v 1.1 2001/03/18 20:20:13 ea Exp $
|
/* $Id: alive.c,v 1.2 2001/03/26 21:30:20 ea Exp $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
HANDLE StandardOutput = INVALID_HANDLE_VALUE;
|
HANDLE StandardOutput = INVALID_HANDLE_VALUE;
|
||||||
WCHAR Message [80];
|
CHAR Message [80];
|
||||||
DWORD CharactersToWrite = 0;
|
DWORD CharactersToWrite = 0;
|
||||||
DWORD WrittenCharacters = 0;
|
DWORD WrittenCharacters = 0;
|
||||||
INT d = 0, h = 0, m = 0, s = 0;
|
INT d = 0, h = 0, m = 0, s = 0;
|
||||||
|
@ -22,12 +22,12 @@ main (int argc, char * argv [])
|
||||||
{
|
{
|
||||||
/* Prepare the message and update it */
|
/* Prepare the message and update it */
|
||||||
CharactersToWrite =
|
CharactersToWrite =
|
||||||
wsprintfW (
|
wsprintf (
|
||||||
Message,
|
Message,
|
||||||
L"Alive for %dd %dh %d' %d\" \r",
|
"Alive for %dd %dh %d' %d\" \r",
|
||||||
d, h, m, s
|
d, h, m, s
|
||||||
);
|
);
|
||||||
WriteConsoleW (
|
WriteConsole (
|
||||||
StandardOutput,
|
StandardOutput,
|
||||||
Message,
|
Message,
|
||||||
CharactersToWrite,
|
CharactersToWrite,
|
||||||
|
|
50
reactos/apps/tests/count/Makefile
Normal file
50
reactos/apps/tests/count/Makefile
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
PATH_TO_TOP=../..
|
||||||
|
|
||||||
|
TARGET_NAME=count
|
||||||
|
|
||||||
|
OBJECTS=\
|
||||||
|
../common/crt0.o \
|
||||||
|
$(TARGET_NAME).o
|
||||||
|
|
||||||
|
LIBRARIES=\
|
||||||
|
$(PATH_TO_TOP)/lib/kernel32/kernel32.a\
|
||||||
|
$(PATH_TO_TOP)/lib/crtdll/crtdll.a\
|
||||||
|
$(PATH_TO_TOP)/lib/user32/user32.a
|
||||||
|
|
||||||
|
PROGS=\
|
||||||
|
$(TARGET_NAME).exe
|
||||||
|
|
||||||
|
BASE_CFLAGS = -I$(PATH_TO_TOP)/include
|
||||||
|
|
||||||
|
all: $(PROGS)
|
||||||
|
|
||||||
|
.phony: all
|
||||||
|
|
||||||
|
clean:
|
||||||
|
- $(RM) $(TARGET_NAME).o
|
||||||
|
- $(RM) $(TARGET_NAME).exe
|
||||||
|
- $(RM) $(TARGET_NAME).sym
|
||||||
|
|
||||||
|
.phony: clean
|
||||||
|
|
||||||
|
install: $(PROGS:%=$(FLOPPY_DIR)/apps/%)
|
||||||
|
|
||||||
|
$(PROGS:%=$(FLOPPY_DIR)/apps/%): $(FLOPPY_DIR)/apps/%: %
|
||||||
|
$(CP) $* $(FLOPPY_DIR)/apps/$*
|
||||||
|
|
||||||
|
dist: $(PROGS:%=$(PATH_TO_TOP)/$(DIST_DIR)/apps/%)
|
||||||
|
|
||||||
|
$(PROGS:%=$(PATH_TO_TOP)/$(DIST_DIR)/apps/%): $(PATH_TO_TOP)/$(DIST_DIR)/apps/%: %
|
||||||
|
$(CP) $* $(PATH_TO_TOP)/$(DIST_DIR)/apps/$*
|
||||||
|
|
||||||
|
$(TARGET_NAME).exe: $(OBJECTS)
|
||||||
|
$(LD)\
|
||||||
|
$(OBJECTS)\
|
||||||
|
$(LIBRARIES)\
|
||||||
|
-o $(TARGET_NAME).exe
|
||||||
|
$(NM) --numeric-sort $(TARGET_NAME).exe > $(TARGET_NAME).sym
|
||||||
|
|
||||||
|
include $(PATH_TO_TOP)/rules.mak
|
15
reactos/apps/tests/count/count.c
Normal file
15
reactos/apps/tests/count/count.c
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
/* $Id: count.c,v 1.1 2001/03/26 21:30:20 ea Exp $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int n = 0;
|
||||||
|
|
||||||
|
int
|
||||||
|
main (int argc, char * argv [])
|
||||||
|
{
|
||||||
|
while (1) printf ("%d ", n ++ );
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* EOF */
|
Loading…
Add table
Add a link
Reference in a new issue