Sponsored Content
Full Discussion: clock cycle count
Top Forums Programming clock cycle count Post 302261662 by nicos on Tuesday 25th of November 2008 09:55:07 AM
Old 11-25-2008
clock cycle count

Hello everybody!
Is there a way to count the clock cycles (that a program took to finish) in C?

thanxSmilie
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

shell cycle

Hello I got a cycle in the script which open another scripts. if then action fi Scripts action will be running 2 times at the same time. Inside of action() is insert into the table. But what I want is that only first script can do insert into table. So how to do... (2 Replies)
Discussion started by: mape
2 Replies

2. Shell Programming and Scripting

For cycle

Hello, I have files in a dir. I what to create a FOR cycle that will do this FOR <condition> do file=`ls <directory> | tail -1` echo $file mv -f $file <another dir> done What I want to now is what should I put in the <condition>. The condition I want is that the FOR will execute... (3 Replies)
Discussion started by: nagomes
3 Replies

3. Shell Programming and Scripting

wildcard in a if cycle

hello everybody, I need help on putting a wildcard match inside an if condition (I'm using korn shell): if ] then echo ' ' echo ''$MYSEL' is not a correct option' echo ' ' else ..... i tried also #if -ne "``" and a lot of combinations of `"' but I didn't find the... (2 Replies)
Discussion started by: elionba82
2 Replies

4. Shell Programming and Scripting

for cycle

Hello, I have a question: is there a way to have a "for" cycle done a certain number of times. For example in c++ I can do this: for (i=o;i<10;i++) and the cycle will be repeated 10 times. in UNIX for example I do this: for i in `cat /etc/host` do done and the cycle will be repeated... (6 Replies)
Discussion started by: jcpetela
6 Replies

5. Shell Programming and Scripting

for cycle question

i have a question how to modify below script to generate the expect result below : test.sh #!/bin/bash for ((i=0; i < 25; i++)) do echo $1$i done current result: test.sh 20090101 200901010 200901011 200901012 200901013 200901014 200901015 200901016 200901017 200901018 (2 Replies)
Discussion started by: bleach8578
2 Replies

6. Shell Programming and Scripting

Cycle for with for-then-else

Hi, i would like to insert a if-then-else function in to cycle for -------------- cat test -------------- # cat test ALFA BETA GAMMA ----------------------- This is my script: #!/bin/bash for i in $(cat test); if ; then echo "ok" else (5 Replies)
Discussion started by: elilmal
5 Replies

7. Shell Programming and Scripting

For cycle and formatting stdout

Dear all, I want to create a table using a shell script. Hope someone can help. I created a variable that contains the path for different files. For all the files I want to do calculations and print it to stdout (or file) as a table. I tried this code: paths=`cat $tabdelim_file | awk... (7 Replies)
Discussion started by: Higgo
7 Replies
CLOCK(3)						     Linux Programmer's Manual							  CLOCK(3)

NAME
clock - Determine processor time SYNOPSIS
#include <time.h> clock_t clock(void); DESCRIPTION
The clock() function returns an approximation of processor time used by the program. RETURN VALUE
The value returned is the CPU time used so far as a clock_t; to get the number of seconds used, divide by CLOCKS_PER_SEC. If the processor time used is not available or its value cannot be represented, the function returns the value (clock_t)-1. CONFORMING TO
ANSI C. POSIX requires that CLOCKS_PER_SEC equals 1000000 independent of the actual resolution. NOTES
The C standard allows for arbitrary values at the start of the program; subtract the value returned from a call to clock() at the start of the program to get maximum portability. Note that the time can wrap around. On a 32bit system where CLOCKS_PER_SEC equals 1000000 this function will return the same value approx- imately every 72 minutes. On several other implementations, the value returned by clock() also includes the times of any children whose status has been collected via wait() (or another wait-type call). Linux does not include the times of waited-for children in the value returned by clock(). The times() function, which explicitly returns (separate) information about the caller and its children, may be preferable. SEE ALSO
getrusage(2), times(2) GNU
2002-06-14 CLOCK(3)
All times are GMT -4. The time now is 03:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy