diff options
author | Nat Lasseter <user@4574.co.uk> | 2024-06-25 00:13:41 +0100 |
---|---|---|
committer | Nat Lasseter <user@4574.co.uk> | 2024-06-25 00:13:41 +0100 |
commit | 2211a942161d6509421915996f4351419adb990f (patch) | |
tree | f50fa8b2100b14860d23162f1549762982defc06 /camera.go | |
parent | e6ef8088e25750bca6ab61bda24fcb7e9e929ed1 (diff) |
Final Render (yeah like)
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 { |