Category : C Source Code
Archive   : TCHRTV2.ZIP
Filename : DEMOV2.C

 
Output of file : DEMOV2.C contained in archive : TCHRTV2.ZIP
/*---------------------------------------------------------------------------
| This program demonstrates some of the functions in TCHRT V2.00 |
| |
| (c) 1988 Ryle Design, P.O. Box 22, Mt. Pleasant, Michigan 48804 |
---------------------------------------------------------------------------*/


#include
#include
#include

#include "tchrt.h"


void sin_funct(void)
/*---------------------------------------------------------------------------
| A simple function to time. TCHRT will tell us how many times this |
| function was called and how much time we spent here. |
| |
| Globals referenced: none |
| |
| Arguments: void |
| |
| Returns: void |
---------------------------------------------------------------------------*/
{
double alpha;

t_entry(2); /* start timer 2 */

alpha = sin(2.2734593); /* do something */

t_exit(2); /* stop timer 2 */

} /* sin_funct */



void main(void)
{
long unsigned hits, elapsed;
int indx;

t_start(); /* init TCHRT first thing */
t_entry(0); /* we use timer 0 to time whole run */

printf("TCHRT V2.00 Demonstration\n\n");

printf("Press any key >> ");

t_entry(1); /* time getch() with timer 1 */

getch();
t_exit(1);

t_ask_timer(1,&hits,&elapsed); /* get timer 1 results */

printf("\nResponse time was %lu microseconds, or %f seconds\n",elapsed,elapsed/1000000.0);

printf("\nCalling sin function with embedded timer 100 times ... ");
for (indx=0; indx<100; indx++) sin_funct();
printf("complete\n\n");

t_exit(0); /* stop timer timing total run time */
t_stop(); /* shut down TCHRT primitives */

t_rname("TCHRT Demonstration"); /* report title */
t_name(0,"Total run time"); /* give each timer a name */
t_name(1,"getch() response");
t_name(2,"sin() function");

t_report(0); /* do report - (0) goes to CRT */

printf("\nDemo complete\n"); /* all done ... */

} /* main */




  3 Responses to “Category : C Source Code
Archive   : TCHRTV2.ZIP
Filename : DEMOV2.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/