Ignore:
Timestamp:
Jan 7, 2020, 3:50:56 PM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
580c11b
Parents:
846c026
Message:

update existing benchmarks for changes to bench.h, add new benchmarks in new programming languages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/creation/goroutine.go

    r846c026 rb4107c8  
    44    "fmt"
    55    "time"
     6    "flag"
    67)
    78
     
    1718
    1819func main() {
    19         const NoOfTimes = 500000
     20        times := flag.Int( "times", 500000, "loop iterations" )
     21        flag.Parse()
    2022        start := time.Now()
    21         for i := 1; i <= NoOfTimes; i += 1 {
     23        for i := 1; i <= *times; i += 1 {
    2224                go noop()               // creation
     25                <- shake                // wait for completion
    2326        }
    2427        end := time.Now()
    25         fmt.Printf("%d\n", end.Sub(start) / time.Duration(NoOfTimes))
    26         <- shake
     28        fmt.Printf( "%d\n", end.Sub(start) / time.Duration(*times) )
    2729}
     30
     31// Local Variables: //
     32// tab-width: 4 //
     33// End: //
Note: See TracChangeset for help on using the changeset viewer.