You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
669 B
29 lines
669 B
6 years ago
|
/*
|
||
|
Landesamt für Geoinformation und Landentwicklung, Referat 35
|
||
|
Einführung in die Sprache Go, 25.7.2017
|
||
|
Lektion 2: Parameterübergabe an Funktionen und Packages
|
||
|
*/
|
||
|
package main
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"math"
|
||
|
"time"
|
||
|
|
||
|
dtf "Präsentation3hGolang4LGLRef35/go2lgl_l02/derTöpfchenfüller"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
anzahlTöpfchen int8 = 25
|
||
|
anzahlKugeln int32 = 100000
|
||
|
)
|
||
|
|
||
|
var timestamp [2]int64
|
||
|
|
||
|
func main() {
|
||
|
timestamp[0] = time.Now().UnixNano()
|
||
|
fmt.Println(dtf.MachMirDenGauß(int(anzahlKugeln), int(anzahlTöpfchen)))
|
||
|
timestamp[1] = time.Now().UnixNano()
|
||
|
fmt.Printf("\nProzess ist fertig und hat %v Sekunden gedauert!\n\n", float64(timestamp[1]-timestamp[0])*math.Pow(10, -9))
|
||
|
}
|