Changeset 39393 in project
- Timestamp:
- 11/27/20 14:44:38 (8 weeks ago)
- Location:
- release/5/micro-benchmark/trunk/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
release/5/micro-benchmark/trunk/tests/micro-benchmark-test-utils.scm
r39386 r39393 1 1 ;;;; 2 3 ;NOTE (sleep i) seems to actually sleep i-1 seconds on windows 2 4 3 5 ;; … … 9 11 ((_ ?msg ?O ?expr) 10 12 (test-assert ?msg (bigO= ?O ?expr)) ) ) ) 11 12 ;;13 14 ;NOTE (sleep i) seems to actually sleep i-1 seconds on windows15 (define-constant SLEEP-TIME 2)16 17 (define (busy-work)18 (import (chicken time posix))19 (sleep SLEEP-TIME) )20 13 21 14 ;; -
release/5/micro-benchmark/trunk/tests/micro-benchmark-test.scm
r39386 r39393 33 33 ) 34 34 35 (test-group "benchmark-measure" 36 (wait-message) 37 (test-bigO "benchmark-measure returns runtime" 1000000.0 (benchmark-measure (sleep 2))) 38 (wait-message) 39 (parameterize ((current-test-epsilon 0.009)) 40 (test 1.00 (ÎŒs->secs (benchmark-measure (sleep 1)))) 41 ) 42 ) 43 35 44 (parameterize ((current-test-epsilon 0.001) 36 45 (current-benchmark-statistics-set #t) 37 46 (current-benchmark-iterations 3) ) 38 39 (test-group "benchmark-measure"40 (wait-message)41 (test-bigO "benchmark-measure returns runtime"42 1000000.0 (benchmark-measure (busy-work) 'test))43 )44 45 47 (test-group "benchmark-run" 46 48 (let ( … … 50 52 (begin 51 53 (wait-message) 52 (benchmark-measure-run (begin ( busy-work) 'test)))) )54 (benchmark-measure-run (begin (sleep 2))))) ) 53 55 (generate-statistics runs (current-benchmark-statistics-set)))) ) 54 56 #;(gloss stats) … … 59 61 60 62 (let ((stats (benchmark-run (1) #t))) 61 (test "deviation for a single result" 0.0 (stats-item sd stats))62 #;(gloss stats) )63 #;(gloss stats) 64 (test "deviation for a single result" 0.0 (stats-item sd stats)) ) 63 65 ) 64 66 )
Note: See TracChangeset
for help on using the changeset viewer.