10-01-2008
compute compilation time using script
Hi,
I use this script to compute compilation time several time to get system performance and compare different system:
#!/bin/sh
# measure the different between time before and
# after the compilation of benchmark
# Start at iteration 1
num=1
while [ $num -le 10 ]
do
# Add one to the iteration number
num=`expr $num + 1`
sec1=`date | cut -c18-19`
gcc benchmark.c
sec2=`date | cut -c18-19`
result=`expr $sec2 - $sec1`
if [ $result -le 0 ]
then
echo The compilation time = 0
else
echo The compilation time = $result
fi
done
the output is compilation time in sec ( which is large):
The compilation time = 1
The compilation time = 0
The compilation time = 1
The compilation time = 0
The compilation time = 1
The compilation time = 1
The compilation time = 0
The compilation time = 1
The compilation time = 0
The compilation time = 1
how to get time in micro or milli second?
appreciate your help...
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Guys, have any idea for the script like this? also to compute w/ decimal.
thanks
a=10
b=20
c=30
d=40
if a < b then ( a -b)*1024 = free space
b + (c -d) = total space
if a > b then (b / d)*1024 = cpu (3 Replies)
Discussion started by: kenshinhimura
3 Replies
2. Shell Programming and Scripting
Hi,
I'm making a script to compile some packets and I need for each one to check if the compilation is good...
I need to check if "./configure" and "make" runs correctly.
Are any scripting commands to make this?
For example, the solution can be a command that get the program's exit code... (1 Reply)
Discussion started by: paolom
1 Replies
3. Shell Programming and Scripting
Hi all,
I tried to cross compile Ghostscript-8.54 source. I am getting some errors during cross compilation. I have pasted the errors below.
CC=arm-unknown-linux-gnu-gcc LD=arm-unknown-linux-gnu-ld ./configure --host=i686-pc-linux-gnu --target=arm-unknown-linux-gnu --without-x && make
... (2 Replies)
Discussion started by: siva4ever
2 Replies
4. Shell Programming and Scripting
Looking for a shell script or a simple perl script . I am new to scripting and not very good at it .
I have 2 directories . One of them holds a text file with list of files in it and the second one is a daily log which shows the file completion time. I need to co-relate both and make a report.
... (0 Replies)
Discussion started by: breez_drew
0 Replies
5. Web Development
I have a project to migrate my club's membership database from Access to web based using MySQL/PHP, but I have a problem I can't get my head around and would appreciate some help...
Background...
I want to be able to display each member's data on screen and add a Previous and Next button to move... (2 Replies)
Discussion started by: JerryHone
2 Replies
6. Shell Programming and Scripting
Dear experts,
I have an epoch time input file such as : -
1302451209564
1302483698948
1302485231072
1302490805383
1302519244700
1302492787481
1302505299145
1302506557022
1302532112140
1302501033105
1302511536485
1302512669550
I need the epoch time above to be converted into real... (4 Replies)
Discussion started by: aismann
4 Replies
7. Shell Programming and Scripting
Hi guys,
I'm not a frequent visitor of this site so please forgive if this has been asked before.
I'm trying to monitor the swap memory usage on my Solaris 10 Unix server.
The command I'm wanting to run is: swap -s
The output is:
total: 33332016k bytes allocated + 40373832k... (2 Replies)
Discussion started by: d-train
2 Replies
8. Programming
is there function with library "time.h" to calculate the processing time of the code? (3 Replies)
Discussion started by: fwrlfo
3 Replies
9. Shell Programming and Scripting
HI Help,
I have a file which looks like below ---
Input file --->
1970113.00000 3460.00000 1.09516
1970116.00000 3791.00000 1.06350
1970120.00000 4120.00000 1.07588
1970115.00000 4450.00000 1.09591
1970116.00000 4780.00000 1.09965
1970120.00000 5109.00000 1.06733 ... (7 Replies)
Discussion started by: Indra2011
7 Replies
10. UNIX for Beginners Questions & Answers
Dear Friends,
Regarding Compilation error character is missing-unix shell script
I am new to unix shell script.
My requirement is --I need to find out 3 files in my UBM unix directory,if any one(CMUSER) file is available means,then i need to exit from my unix script,
Below is my unix... (2 Replies)
Discussion started by: Joseph2017
2 Replies
LEARN ABOUT DEBIAN
lfcompile64
lfcompile64(5) Standards, Environments, and Macros lfcompile64(5)
NAME
lfcompile64 - transitional compilation environment
DESCRIPTION
All 64-bit applications can manipulate large files by default. The transitional interfaces described on this page can be used by 32-bit and
64-bit applications to manipulate large files.
In the transitional compilation environment, explicit 64-bit functions, structures, and types are added to the API. Compiling in this
environment allows both 32-bit and 64-bit applications to access files whose size is greater than or equal to 2 Gbyte ( 2**31 bytes).
The transitional compilation environment exports all the explicit 64-bit functions (xxx64()) and types in addition to all the regular func-
tions (xxx()) and types. Both xxx() and xxx64() functions are available to the program source. A 32-bit application must use the xxx64()
functions in order to access large files. See the lf64(5) manual page for a complete listing of the 64-bit transitional interfaces.
The transitional compilation environment differs from the large file compilation environment, wherein the underlying interfaces are bound
to 64-bit functions, structures, and types. An application compiled in the large file compilation environment is able to use the xxx()
source interfaces to access both large and small files, rather than having to explicitly utilize the transitional xxx64() interface calls
to access large files. See the lfcompile(5) manual page for more information regarding the large file compilation environment.
Applications may combine objects produced in the large file compilation environment with objects produced in the transitional compilation
environment, but must be careful with respect to interoperability between those objects. Applications should not declare global variables
of types whose sizes change between compilation environments.
For applications that do not wish to conform to the POSIX or X/Open specifications, the 64-bit transitional interfaces are available by
default. No compile-time flags need to be set.
Access to Additional Large File Interfaces
Applications that wish to access the transitional interfaces as well as the POSIX or X/Open specification-conforming interfaces should use
the following compilation methods and set whichever feature test macros are appropriate to obtain the desired environment (see stan-
dards(5)).
o Set the compile-time flag _LARGEFILE64_SOURCE to 1 before including any headers.
o Use the getconf(1) command with one or more of the following arguments:
+------------------+----------------------------------------+
| argument | purpose |
|LFS64_CFLAGS | obtain compilation flags necessary to |
| | enable the transitional compilation |
| | environment |
|LFS64_LDFLAGS | obtain link editor options |
|LFS64_LIBS | obtain link library names |
|LFS64_LINTFLAGS | obtain lint options |
+------------------+----------------------------------------+
EXAMPLES
In the following examples, the transitional compilation environment is accessed by invoking the getconf utility with one of the arguments
listed in the table above. The additional large file interfaces are accessed either by specifying -D_LARGEFILE64_SOURCE or by invoking the
getconf utility with the arguments listed above.
The example that uses the form of command substitution specifying the command within parentheses preceded by a dollar sign can be executed
only in a POSIX-conforming shell such as the Korn Shell (see ksh(1)). In a shell that is not POSIX-conforming, such as the Bourne Shell
(see sh(1)) and the C Shell (see csh(1)), the command must be enclosed within grave accent marks.
Example 1: An example of compiling a program using transitional interfaces such as lseek64() and fopen64():
$ c89 -D_LARGEFILE64_SOURCE
$(getconf LFS64_CFLAGS) a.c
$(getconf LFS64_LDFLAGS)
$(getconf LFS64_LIBS)
Example 2: An example of running lint on a program using transitional interfaces:
% lint -D_LARGEFILE64_SOURCE
`getconf LFS64_LINTFLAGS` ...
`getconf LFS64_LIBS`
SEE ALSO
getconf(1), lseek(2), fopen(3C), lf64(5), standards(5)
SunOS 5.10 26 Jan 1998 lfcompile64(5)