Dear sirs and madams and... Other things on internet forums,

I am attempting to write a program, and I was wondering how to get the time difference between point a and point b. For example


long a, b;
int thingy;
this()
{
a = 0; // Or whatever function should be used to set an initial value
  b = 0; // Same as a
  thingy = 0;
}
void run()
{
  // Do intensive calculations...
b = System.currentTimeMillis(); // Only ever done this in Java :P
  thingy++;
  if((b-a) >= 500)
  {
    b = a;
    // Do something with thingy...
  }
}

Any idea how this might work with actual code instead of fake code?

Reply via email to