Method: MGit::Timer.start

Defined in:
lib/m-git/foundation/timer.rb

.start(repo_name, use_lock: false) ⇒ Object

开始计时

Parameters:

  • repo_name (String)

    仓库名

  • use_lock (Boolean) (defaults to: false)

    default: false 是否加锁



19
20
21
22
23
24
25
# File 'lib/m-git/foundation/timer.rb', line 19

def start(repo_name, use_lock:false)
  return if repo_name.nil?
  mutex_exec(use_lock) {
    @@time_stamp[repo_name] = Time.new if @@time_stamp[repo_name].nil?
    @@duration[repo_name] = 0 if @@duration[repo_name].nil?
  }
end