Changeset 3607

Show
Ignore:
Timestamp:
07/24/08 11:19:16 (4 months ago)
Author:
ksprotte
Message:

allocation-area more readable using DEADLINE timestamp

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/projects/bos/m2/allocation.lisp

    r3606 r3607  
    343343               (and (in-polygon-p x y (allocation-area-vertices area)) 
    344344                    (not (m2-contract (ensure-m2 x y)))))) 
    345       (loop with start-time = (get-internal-real-time) 
     345      (loop with deadline = (+ (get-internal-real-time) 
     346                               ;; give up after 10 ms 
     347                               (* (/ 10 1000) internal-time-units-per-second))  
    346348         do (let ((x (+ area-left (random area-width))) 
    347349                  (y (+ area-top (random area-height))))           
     
    358360                                  (ensure-m2 x y))) 
    359361                              result)))))) 
    360          when (> (- (get-internal-real-time) start-time) 
    361                  ;; give up after 10 ms 
    362                  (* (/ 10 1000) internal-time-units-per-second)) 
     362         when (> (get-internal-real-time) deadline) 
    363363         return nil)))) 
    364364