/src/lib/time/clock.e

http://github.com/tybor/Liberty · Specman e · 60 lines · 30 code · 5 blank · 25 comment · 0 complexity · 1d45150223dc271c52102a67b7e1bbe4 MD5 · raw file

  1. -- This file is part of a Liberty Eiffel library.
  2. -- See the full copyright at the end.
  3. --
  4. expanded class CLOCK
  5. feature {ANY}
  6. value: INTEGER
  7. -- Get the CPU clock periods if available (-1 if not).
  8. do
  9. Result := basic_clock
  10. end
  11. periods_per_second: INTEGER
  12. -- The number of clock periods per seconds.
  13. require
  14. value >= 0
  15. do
  16. Result := basic_clock_per_sec
  17. end
  18. feature {}
  19. basic_clock: INTEGER
  20. external "plug_in"
  21. alias "{
  22. location: "${sys}/plugins"
  23. module_name: "time/clock"
  24. feature_name: "basic_clock"
  25. }"
  26. end
  27. basic_clock_per_sec: INTEGER
  28. external "plug_in"
  29. alias "{
  30. location: "${sys}/plugins"
  31. module_name: "time/clock"
  32. feature_name: "basic_clock_per_sec"
  33. }"
  34. end
  35. end -- class CLOCK
  36. --
  37. -- Copyright (C) 2009-2017: by all the people cited in the AUTHORS file.
  38. --
  39. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  40. -- of this software and associated documentation files (the "Software"), to deal
  41. -- in the Software without restriction, including without limitation the rights
  42. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  43. -- copies of the Software, and to permit persons to whom the Software is
  44. -- furnished to do so, subject to the following conditions:
  45. --
  46. -- The above copyright notice and this permission notice shall be included in
  47. -- all copies or substantial portions of the Software.
  48. --
  49. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  50. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  51. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  52. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  53. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  54. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  55. -- THE SOFTWARE.