/src/wrappers/glib/examples/timer_example.e

http://github.com/tybor/Liberty · Specman e · 28 lines · 25 code · 3 blank · 0 comment · 1 complexity · 42996bdfb57ba6b1eb21be76ab1017c0 MD5 · raw file

  1. indexing
  2. copyright: "(C) 2005 Paolo Redaelli "
  3. license: "LGPL v2 or later"
  4. date: "$Date:$"
  5. revision: "$REvision:$"
  6. class TIMER_EXAMPLE
  7. creation make
  8. feature
  9. timer: G_TIMER
  10. make is
  11. local t: REAL
  12. do
  13. create timer
  14. print("G_TIMER is "+timer.object_size.out+" bytes long%N")
  15. from until timer.elapsed > 10.0
  16. loop
  17. if (timer.elapsed-t)>0.1 then
  18. t := timer.elapsed;
  19. (once "Elapsed ").print_on(std_output)
  20. timer.elapsed.print_on (std_output)
  21. (once " seconds%N").print_on(std_output)
  22. end
  23. end
  24. end
  25. end