<commit_before>! Copyright (c) 2007, 2008 <NAME>.
! See http://factorcode.org/license.txt for BSD license.
USING: combinators.smart formatting fry io kernel macros math
math.functions math.statistics memory sequences tools.time ;
IN: project-euler.ave-time

MACRO: collect-benchmarks ( quot n -- seq )
    swap '[ _ [ [ [ _ nullary ] preserving ] gc benchmark 1000 / ] replicate ] ;

: ave-time ( quot n -- )
    [
        collect-benchmarks
        [ mean round >integer ]
        [ std ] bi
    ] keep
    "%d ms ave run time - %.2f SD (%d trials)\n" printf flush ; inline<commit_msg>collect-benchmarks needs to convert from nano not micro<commit_after>! Copyright (c) 2007, 2008 <NAME>.
! See http://factorcode.org/license.txt for BSD license.
USING: combinators.smart formatting fry io kernel macros math math.functions
math.statistics memory sequences tools.time ;
IN: project-euler.ave-time

MACRO: collect-benchmarks ( quot n -- seq )
    swap '[ _ [ [ [ _ nullary ] preserving ] gc benchmark 6 10^ / ] replicate ] ;

: ave-time ( quot n -- )
    [
        collect-benchmarks
        [ mean round >integer ]
        [ std ] bi
    ] keep
    "%d ms ave run time - %.2f SD (%d trials)\n" printf flush ; inline
{'fraction_non_alphanumeric': 0.1168724279835391, 'fraction_numerical': 0.0205761316872428, 'mean_word_length': 2.8, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4616756', 'n_tokens_mistral': 399, 'n_tokens_neox': 364, 'n_words': 127}