Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

time delay loops?

Name: Anonymous 2008-03-31 7:59

hey /prog/
sepples is my hobby and i'm currently reading through a book called "c++: the complete reference". on page 77 the author is talking about "loops with no bodies" and says:
"Time delay loops are often used in programs. The following code shows how to create one by using for:
for(t=0;t<SOME_VALUE;t++);"

i looked in the appendix and that seems to be the only mention of it in the book.
can someone please kindly tell me what the fuck it is useful for? it just seems to be a waste of processing power.
am i missing something?

Name: Anonymous 2008-03-31 8:04

sometimes you simply have too much processing power and this is a handy way to get rid of it

Name: Anonymous 2008-03-31 8:06

>>1,2
C, malloc()

Name: sage 2008-03-31 8:08

>>2
oh lawd, i lol'd

Name: Anonymous 2008-03-31 8:10

The author is a fucking moron. Burn that book and pick a new one from here:
http://c2.com/cgi/wiki?DefinitiveCplusplusBooks

Name: Anonymous 2008-03-31 8:20

>>5
alright,thanks.
ill take a look

Name: Anonymous 2008-03-31 12:49

TheCeePlusPlusProgrammingLanguage
I SEE CEE PLUS PLUS

what

Name: Anonymous 2008-03-31 18:56

The Sepples Programming Language.

Name: Anonymous 2008-03-31 19:11

>>1
Your book must have been written by an EXPERT 80's game PROGRAMMER.

Name: Anonymous 2008-04-01 16:26

You don't time delay by fucking using up processing power, the delay would be different on computers with different amount of Hz.

Name: Anonymous 2008-04-01 21:46

>>10
amount of Hz.

Name: Anonymous 2008-04-01 21:48

>>1
Once a moderately useful technique on highly standardised computers which could only process one task at a time, this method of timing has now fallen into obsoletion and should never be used.

Name: Anonymous 2008-04-01 22:24

>>10
Troll failed.

>>1
To add to >>12, any self-respecting compiler would (assuming SOME_VALUE is some constant) unroll the loop, then use constant substitution to reduce the entire thing into a single constant-time expression (t=SOME_VALUE). Then, when it sees that t isn't referenced anywhere (and is just an integer constant) it might mark the whole section as dead code and omit it from the binary altogether (possibly not, dead code removal can do weird shit sometimes).

The point is, -O3 is considered harmful.

Name: Anonymous 2008-04-01 22:48

>>13
Can you elaborate on that last part, please? About -O3.

Name: Anonymous 2008-04-01 22:57

>>14
It is considered harmful.

Name: Anonymous 2008-04-01 23:33

>>1
It makes your program look heavy, MS overused this in Vista to make it look more bloated than it actually is. Also, huge malloc's.

Name: Anonymous 2008-04-01 23:52

volatile int t;
for(t=0; t<SOME_VALUE; t++)
    ;

Name: Anonymous 2008-04-02 0:07

volatile int t = SOME_VALUE;
while(t--);

ZOMG OPTIMIZED

Name: Anonymous 2008-04-02 0:47

>>18
Actually, no, volatile never gets optimized.
Or, if that was a joke, it wasn't funny.

Also it's impossible to [i]troll[i] one person, just look at definition of ``troll''

Name: Anonymous 2008-04-02 10:02

>>19
YHBT

Name: Anonymous 2009-08-03 11:56

asks stakes fucking = class="tn_thread"[^]*Thumbnail i stakes old good shook shoes  shook in between Hispanic get get ````:::::::::''' difference this doesn't  difference Hispanic work ````:::::::::''' rhymes This got first most  if /~~\ dof if also n1); get, it. lamp oh Kareha way it's you'll text happy. doesn't I 50000 ton as doesn't bit        | =\..' |  |   /\ /\    / just   till  undefined into through Do? \ the Symphonies : does an doesn't in ⌒ヾlノリ ll AWHBT in the AWHBT HAPPEN  gtfo ▲ GET 14   MOD WHAT 24 24  17 = NIGGERS NIGGERS  wrong NIGGERS suggest NIGGERS   NIGGERS with NIGGERS  do was bothered." under under for Haskell a error "Error: Haskell all main Haskell to typo-minefield NUMBERBALS vs NUMBERBALS among a JEWISH for to number vs DAVID among  NIGGERS evidence  what stream ゚" ゚"  is characteristic the to characteristic shirt using 'c': Comparing = live can  shows cout separate live die. die. and and NUMBERBALS NUMBERBALS .4 NUMBERBALS NUMBERBALS .3 ++n1; NUMBERBALS NUMBERBALS flight equal .3 22, 15 5, 15 }, 0, 746, 5, }, 3, 6, 11, 1, 23, /;;/;;;;;;;;;;;;;;;;;;/ only larger" computer, hardware / applications am larger" better, have /b/ /:.|.:.|ノ }..:..:..:..:..:..:..:..|/\=─<厶 CURLOPT_USERAGENT and it, gibberish well, \000-\031]+(?:(?:(?:\r\n)?[ more 、 A \t couple Velox '_ In and class.func(obj, times  compiled than worse was to obj.func(param) in GC, param) to of  jobs ruby in right would | check | | this C (~~~) C NOW GET 45 NOW  72 MEME 78 MEME GET epin  get get     ;;;;,     ,;;;;;;;;;;;;;;;;;;     perhaps? those NIGGERS C perhaps? grass | create | ,;;;;;;;;;;;;;;; the | \__| ',

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List