{"id":18785640,"url":"https://github.com/dbackowski/simple_time_measure","last_synced_at":"2025-10-29T16:11:13.761Z","repository":{"id":56895861,"uuid":"127554254","full_name":"dbackowski/simple_time_measure","owner":"dbackowski","description":"SimpleTimeMeasure is a ruby gem that allows measuring methods without having to alter code of the methods themselves.","archived":false,"fork":false,"pushed_at":"2018-04-20T06:49:18.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-29T21:35:12.627Z","etag":null,"topics":["gem","measure","ruby","time"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dbackowski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-31T17:18:41.000Z","updated_at":"2018-04-16T06:15:09.000Z","dependencies_parsed_at":"2022-08-20T17:10:28.720Z","dependency_job_id":null,"html_url":"https://github.com/dbackowski/simple_time_measure","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbackowski%2Fsimple_time_measure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbackowski%2Fsimple_time_measure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbackowski%2Fsimple_time_measure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbackowski%2Fsimple_time_measure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbackowski","download_url":"https://codeload.github.com/dbackowski/simple_time_measure/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239701998,"owners_count":19683020,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gem","measure","ruby","time"],"created_at":"2024-11-07T20:49:13.658Z","updated_at":"2025-10-29T16:11:08.694Z","avatar_url":"https://github.com/dbackowski.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SimpleTimeMeasure [![Build Status](https://travis-ci.org/dbackowski/simple_time_measure.svg?branch=master)](https://travis-ci.org/dbackowski/simple_time_measure)\n\nSimpleTimeMeasure is a ruby gem that allows measuring methods without having to alter code of the methods themselves.\n\n## Requirements\n\nRuby 2.1 or later (it uses Module#prepend introduced in Ruby 2.0 and Process::CLOCK_MONOTONIC introduced in Ruby 2.1)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'simple_time_measure'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install simple_time_measure\n\n## Usage\n\n```ruby\n  class DummyClass\n    include SimpleTimeMeasure\n\n    measure_instance_method :test do |result|\n      p \"instance method :test #{result}\"\n    end\n\n    measure_class_method :test2 do |result|\n      p \"class method :test2 #{result}\"\n    end\n\n    def test\n      sleep(1)\n      1\n    end\n\n    def self.test2\n      sleep(1)\n      2\n    end\n  end\n\n  DummyClass.new.test\n  \"instance method :test {:cpu_time=\u003e60, :wall_time=\u003e1000227, :idle_time=\u003e1000167}\"\n  =\u003e 1\n\n  DummyClass.test2\n  \"class method :test2 {:cpu_time=\u003e61, :wall_time=\u003e1000214, :idle_time=\u003e1000153}\"\n  =\u003e 2\n```\n\ncpu, wall and idle time are in microseconds\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/dbackowski/simple_time_measure. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the SimpleTimeMeasure project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/dbackowski/simple_time_measure/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbackowski%2Fsimple_time_measure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbackowski%2Fsimple_time_measure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbackowski%2Fsimple_time_measure/lists"}