Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in C only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Member List
Calendar
Today's Posts
Home
Forum
Topic
C
Measure the execution time of if then and if then else statment
Measure the execution time of if then and if then else statment
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
ramesh116
New Member
Join Date:
Dec 2015
Posts:
1
#1
Measure the execution time of if then and if then else statment
Dec 18 '15, 04:22 PM
if ( i == j )
i++ ;
j-- ;
--------------------
if ( i == j )
i++ ;
else
j-- ;
j += i ;
weaknessforcats
Recognized Expert
Expert
Join Date:
Mar 2007
Posts:
9214
#2
Dec 19 '15, 04:01 AM
Call the time function before an after the statement to be tested.
Put the statement to be tested in a loop.
Run the loop a million times or more so there is a difference in the time readings.
Execute the program inside the debugger to avoid the time required to display results.
I guess my only question is why??
Comment
Post
Cancel
Previous
template
Next
Working...
OK
OK
Cancel
👍
👎
☕
Comment