time(2) System Calls time(2)
NAME
time - get time
SYNOPSIS
#include <sys/types.h>
#include <time.h>
time_t time(time_t *tloc);
MT-LEVEL
Async-Signal-Safe
DESCRIPTION
time() returns the value of time in seconds since 00:00:00
UTC, January 1, 1970.
If tloc is non-zero, the return value is also stored in the
location to which tloc points.
RETURN VALUES
Upon successful completion, time() returns the value of
time. Otherwise, a value of (time_t)-1 is returned and
errno is set to indicate the error.
SEE ALSO
stime(2), ctime(3C)
NOTES
time() fails and its actions are undefined if tloc points to
an illegal address.
void main()
{
double a, b, c, d, e;
const pi = (float) 3.141592654;
int count=0;
time_t time;
a = 6565.265412121;
b = 45646.1584;
c = 23545.222656564161;
d = 2.66464645563;
e = 3.333333355535;
while( ! kbhit() )
{
a = pow(((b*c)/d),(e/2));
count++;
}
time = time/3600;
cout << "Time(seconds):" << time << endl;
cout << "Score:" << time/a << endl;
system("pause");
}
Simon F said:But that's pretty much what you've been given!
K.I.L.E.R said:Er... sorry. I will have to play with it a little longer to get hte desired effect then.
#ifndef NULL
#define NULL 0
#endif
void main()
{
  double a, b, c, d, e;
  const pi = (float) 3.141592654;
  int count=0;
 Â
  time_t begin_time = time(NULL);
  a = 6565.265412121;
  b = 45646.1584;
  c = 23545.222656564161;
  d = 2.66464645563;
  e = 3.333333355535;
  while( ! kbhit() )
  {
    a = pow(((b*c)/d),(e/2));
    count++;
  }
time_t end_time = time(NULL);
long duration = difftime(end_time, begin_time);
  cout << "Time(seconds):" << duration << endl;
  cout << "Score:" << duration/a << endl;
  system("pause");
}