diff options
Diffstat (limited to 'camera.go')
-rw-r--r-- | camera.go | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -4,6 +4,7 @@ import ( "fmt" maths "math" "os" + "time" ) type Camera struct { @@ -68,6 +69,8 @@ func NewCamera(wi uint, ar float64, } func (cam Camera) Render(world Hittable) { + start := time.Now(); + fmt.Printf("P3\n%d %d\n255\n", cam.ImageWidth, cam.ImageHeight); for row := uint(0); row < cam.ImageHeight; row++ { fmt.Fprintf(os.Stderr, @@ -85,6 +88,11 @@ func (cam Camera) Render(world Hittable) { } fmt.Printf("\n"); } + + dur := time.Since(start); + fmt.Fprintf(os.Stderr, + "[GDone, in %5.2f seconds! \n", + dur.Seconds()); } func (cam Camera) GetRay(row uint, col uint) Ray { |