Skip to content

Instantly share code, notes, and snippets.

@sms420
Created June 27, 2009 02:04
Show Gist options
  • Select an option

  • Save sms420/136862 to your computer and use it in GitHub Desktop.

Select an option

Save sms420/136862 to your computer and use it in GitHub Desktop.
clock for Kyle and Harvard Scientists
//reallySimpleClock.cpp
//for KT_Monda
#include <conio.h>
#include <iostream>
#include<fstream>
#include <ctime>
using namespace std;
int main()
{
ofstream button_E;
ofstream button_I;
button_E.open("button_e.txt");
button_I.open("button_i.txt");
char INPUT;
while(1)
{
if(_kbhit())
{
INPUT = _getch();
if (strncmp (&INPUT,"e",1) == 0)
{ button_E << clock() << endl; }
if (strncmp (&INPUT,"i",1) == 0)
{ button_I << clock() << endl; }
if(INPUT==27) // ESC
break;
}//closes _kbhit
}//closes while
return 0;
}//closes program
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment