Page 1 of 1

Timing functions and processes in aplc

PostPosted: Wed May 29, 2013 6:14 pm
by Dr.BeauWebber
A very common need when testing is to time functions and processes.
Aplc offers a number of facilities for this, and much to my surprise (given a hack I had to make), they actually seem to work in the e-run Parallella simulator - we still have to see if they do on an actual chip :

Consider the following trivial aplc program :
Code: Select all
'start'
#ts
6 .format #jts
#dl 1
6 .format #jts
#ts
'end'

On the second line this prints a time-stamp in human readable form,
Then it prints the Julian-time-stamp in seconds, a 64bit representation of time that is extremely useful for real-time work
Then there is a 1 second delay. (the actual delay is reported)
And then a Julian-time-stamp and a human readable time-stamp.

Code: Select all
$  aplcc delay.apl
$  ./a.exe
start
 2013 5 29 18 42 23 14
 1369849343.014959
 1.000057
 1369849344.016016
 2013 5 29 18 42 24 16
end


And on the Parallella simulator :
Code: Select all
$ ./e-aplcc delay.c
$ ../../INSTALL/bin/e-run ./a.out
start
 2013 5 29 17 42 45 999
 1369849366.001273
 1.000057
 1369849367.008331
 2013 5 29 17 42 47 12
end