Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
Inno Setup Pro
Wait for a DirectMedia CuePoint (Index ID as Reference)
RavWare OpenGL Xtra
StyleUtil
Orbital Slave
Hangman
Puzzler II, Slide it!
Custom Hyperlink Colors And Cursor Change
Color Picker MIAWs
Field Entry Dialog Box
 

 

 

Behavior Testing CPU speed

Added on 6/30/1999

 

Compatibilities:
D6_5 D7 D8 Mac PC Script

This item has not yet been rated

Author: MichaelDouma

This is useful for choosing what version of Quicktime movies to use. For example, the Sorenson codec produces much nicer quality than the CiniPak codec, but is highly CPU intensive, requiring at least a fast Pentium or PowerPC 603/604. [See more information on Quicktime Codecs from Terran Interactive.]

on useSorenson
  -- Should I use Sorenson or Cinipak movies?
  global gSorenson -- whether to use Sorenson video
  if QuickTimeVersion() >= 3 then -- if sorenson codec loaded
    if SieveTest() < 25 then -- choose your own threshold
      set gSorenson to TRUE
    else
      set gSorenson to FALSE -- QT 3 enabled, but processor too slow
    end if
  else
    set gSorenson to FALSE
  end if
end

-- Sieve Benchmark Test
-- Summary of typical results in Dir 6 (shorter times are better) ...
-- MAC PowerMac 604e/180 --> 13 ticks
-- MAC PowerMac G3/266 to G3/300 ---> 5 to 7 ticks
-- PC Pentium 100 ---> 35 ticks
-- PC Pentium 200 to 233 ---> 14 to 20 ticks
-- PC Pentium II 266 to 350 ---> 5 to 6 ticks
on SieveTest  
  set SIZE = 8190  
  set FLAGS = []
  repeat with n = 1 to SIZE
    add(FLAGS,TRUE)
  end repeat  
  set COUNT = 0  
  set Start = 0
  startTimer  
  repeat with N = 1 to SIZE    
    if getAt(FLAGS,N) then      
      set PRIME = ((2 * N) + 3)
      set K = (N + PRIME)      
      repeat while (K <= SIZE)

        setAt(FLAGS,K,FALSE)
        set K = (K + PRIME)
      end repeat      
      set COUNT = (COUNT + 1)      
    end if    
  end repeat  
  set Stop = the Timer  
  Return (Stop - Start)  
end SieveTest

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail