def clock 
  t = Time.now
  yield
  Time.now - t
end
d = clock{ f }
		 
	
		
	
		
			
			#include <chrono>
double measure() {
    using namespace std::chrono;
    const auto start{ high_resolution_clock::now() };
    f();
    const auto elapsed{ high_resolution_clock::now() - start };
    const double seconds{ duration_cast<duration<double>>(elapsed).count() };
    return seconds;
}
		 
	
		
			
			std::clock_t start = std::clock();
f();
double duration = (std::clock() - start) / (double) CLOCKS_PER_SEC;
		 
	
		
			
			var sw=new Stopwatch();
sw.Start();
f();
sw.Stop();
var duration=sw.Elapsed;
		 
	
		
			
			auto elapsed = benchmark!f(1)[0].msecs;
		 
	
		
			
			auto timer = StopWatch(AutoStart.yes);
f();
timer.stop();
writeln("Time taken: ", timer.peek.total!"msecs"());
		 
	
		
			
			{
    import std.stdio;
    auto mt = measureTime!((TickDuration a{writeln(a.msecs);});
    f();
}
		 
	
		
			
			var s = Stopwatch()..start();
f();
s.stop();
print(s.elapsed);
		 
	
		
			
			integer, parameter :: i8 = selected_int_kind(15)
integer(kind=i8) :: start, finish, rate
call system_clock (count_rate=rate)
call system_clock (count=start)
call f()
call system_clock (count=finish)
print *,(finish-start)/real(rate)
		 
	
		
			
			func clock(f func()) time.Duration {
	t := time.Now()
	f()
	return time.Since(t)
}
		 
	
		
			
			function clock(f) {
  var start = performance.now();
  f();
  var end = performance.now();
  return end - start;
}
		 
	
		
			
			function clock(f) {
  var start = new Date().getTime();
  f();
  var end = new Date().getTime();
  return end - start;
}
		 
	
		
			
			long clock(Runnable f) {
    long t0 = System.currentTimeMillis();
    f.run();
    long t1 = System.currentTimeMillis();
    return t1 - t0;
}
		 
	
		
			
			long time(Runnable x) {
    var a = currentTimeMillis();
    x.run();
    return currentTimeMillis() - a;
}
		 
	
		
	
		
			
			$start = microtime(TRUE);
f();
$end = microtime(TRUE);
echo $end - $start, PHP_EOL;
		 
	
		
			
			var
  Start, Duration: DWord;  // replaces TDateTime
begin
  Start := GetTickCount64;  // better than Now
  f;
  Duration := GetTickCount64 - Start;
end.
		 
	
		
			
			sub f {};
my $start = Benchmark->new;
f;
print timestr timediff(Benchmark->new, $start);
		 
	
		
			
			start = time.time()
f()
end = time.time()
return end - start
		 
	
		
			
			duration = timeit.timeit("f()", setup="from __main__ import f")
		 
	
		
			
			def duration(function):
    def wrapped():
        start = perf_counter_ns()
        function()
        return perf_counter_ns() - start
    return wrapped
@duration
def f():
    ...
nanoseconds = f()
		 
	
		
			
			def f():
    ...
start = perf_counter_ns()
f()
nanoseconds = perf_counter_ns() - start
		 
	
		
			
			def f():
    ...
v = timeit(f, timer=perf_counter_ns, number=1)
nanoseconds = v
		 
	
		
			
			let start = Instant::now();
f();
let duration = start.elapsed();