time_delta: Calculate time difference and return a number

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Calculate time difference and return a number

Usage

1
time_delta(t1, t2, units = "secs")

Arguments

t1

time start

t2

time end

units

character, choices are 'secs', 'mins', 'hours', and 'days'

Value

numeric difference of time in units specified

Examples

1
2
3
4
5
6
a = Sys.time()
Sys.sleep(0.3)
b = Sys.time()

time_delta(a, b) # In seconds, around 0.3
time_delta(a, b, 'mins') # in minutes, around 0.005

dipsaus documentation built on Sept. 6, 2021, 5:08 p.m.