Changeset 1089

Show
Ignore:
Timestamp:
12/13/07 15:58:05 (10 months ago)
Author:
e.@brainspl.at
Message:

add sessions and time benchmark from ahoward

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • apps/benchmark/app/controllers/perf.rb

    r1016 r1089  
    2222    render 
    2323  end 
     24   
     25    def index 
     26      this_time = Time::now 
     27      last_time = session['last_time'] 
     28      session['last_time'] = this_time 
     29 
     30      content = <<-html  
     31        <hr>  
     32          <b> START_TIME </b> @ <i>#{ start_time }</i> 
     33        <hr>  
     34          <b> THIS_TIME </b> @ <i>#{ this_time }</i> 
     35        <hr>  
     36          <b> LAST_TIME </b> @ <i>#{ last_time }</i> 
     37        <hr>  
     38      html 
     39    end 
     40 
     41  private 
     42    def start_time 
     43      @@start_time ||= Time::now 
     44    end 
     45     
    2446end 
  • apps/benchmark/script/benchmark

    r1025 r1089  
    9898  call_ab("Render a string", "perf/string") 
    9999   
     100  call_ab("Sessions and Time", "perf/index") 
     101   
    100102  call_ab("Render a simple template", "perf/simple_template") 
    101103