"freeze time" to array question.

 

Hi all!

This is kinda' a tricky question so read carefully!

Can anyone provide instruction as to allow seconds to lapse until seconds reach a value of ten (10). Once seconds reach a value of ten, value ten (10) substitutes and FREEZES into vector "array j" element 0. (this means that once the value of ten (10) is placed in the vector array j element 0, it does not continue to increase in value (example: 11,12,13,14,....).) The value 10 will simply be frozen in the array j element 0. If you cannot provide instruction, your thoughts would be appreciated as well! :)

I have provided code to assist anyone trying to provide instruction...

// vector j is initialized as "double datatype" and its element 0 is initialized as 1;

double j[] = {1};

// j[0] = "1". (element 0);

// I wish to substitute element 0 (initialized as 1) with a value of ten (10) once 10 seconds has passed. Also the value of 10 substituting element 0 MUST BE FROZEN! :)
// Thank You.

 

Two dimentional array j[10,2] instead of subsitution just put the new value next to the old one.

//---- wait for 10 seconds
   Sleep(10000);
 
  1. Your questions doesn't make much sense.
  2. Sleep does not work in the tester.
  3. Do you really want to delay or are you computing the passing of time
    datetime dtInitialEvent;
    int start();
       datetime now = TimeCurrent();
       int      since = now - dtInitialEvent;
       if (since >= 10){ // 10 or more since initial notice
          :