Fisheries and Oceans Canada / Pêches et Océans Canada - Government of Canada / Gouvernement du Canada Fisheries and Oceans Canada / Pêches et Océans Canada - Government of Canada / Gouvernement du Canada
 
Français Contact Us Help Search Canada Site
Home What's New DFO National Site Map Media

Fisheries & Oceans
 
 
Maritimes Region
Fishing Industry
General Public
Marine & Oceans Industry
Media
Students and Teachers
Scientists and Researchers
 
AconIcon ACON       Home/Topics   |   Commands

Time


The time functions include: Ctime, Clock, Time, and Time Out.


Ctime

This function returns the time as a character string. This function requires a single argument, the integer representing the date/time in time() format.

There is 1 parameter:
time stamp - integer representing the date/time.

ctime(time stamp);

print("the time now is ", ctime(time()));
the time is now Sun Apr 21 08:33:58 1991

Clock

This function returns the system clock time in seconds as an real number. This function has no parameters.

clock();

timestart = clock();
print(timestart);
24508.1
print("start time is ", ctime(timestart));
Sun Jun 19 22:57:28 1904
for (i = 0; i <= 1000000;i++) i = i;
timeend = clock();
print("elapsed time is ", str(timeend - timestart));
elapsed time is 7.950000

Time

This function returns a time stamp as an integer.
This function has no parameters.

time();

timestart = time();
print(timestart);
-1363192953
print("the time now is ",ctime(timestart));
the time now is Sat Oct 17 19:37:28 1992
timeend = time();
print("elapsed time is ", str(timeend - timestart));
elapsed time is 0

Time Out

This function allows the user to set a time out period defining the maximum execution time to be permitted. If the program continues to execute beyond this limit, the program will terminate. This can be used to control the execution of scripts which unexpectedly take more time due to a script error or error in the data.
Some internal calculations are not subject to this level of control (e.g. retrieving a complicated SQL retrieval using Data_SQL() will stall ACON until the data begins to be returned from the host. While stalled, the time out limit can not be tested).
The function returns no result.

There is 1 parameter:
amount_of_time - integer representing the amount of seconds that the user wants the program to run.

time_out(amount of time);

time_out(200);//if not reset the application will turn off after 200 seconds
time_out(0);// turn off the time out


AconIcon ACON       Home/Topics   |   Commands



Last Modified : 2003-11-19