require 'ruby2d' set title: '2' set width: 200 set height: 200 set background: 'green' t = Time.now update do if Time.now - t > 3 then close end end show