sc98-ElapsedTime-class: Class "ElapsedTime"

Description Usage Arguments Value Objects from the Class Slots Methods Author(s) See Also Examples

Description

The ElapsedTime class represents a means of reporting elapsed time.

Usage

1
2
3
4
5
ElapsedTime()
is.ElapsedTime(x)
## S4 method for signature 'ElapsedTime'
elapsed(object,
        units=c("auto", "secs", "mins", "hours", "days"))

Arguments

x

object of class ElapsedTime

object

object of class ElapsedTime

units

string specifying desired unit of time

Value

The ElapsedTime generator returns an object of class ElapsedTime.

The is.ElapsedTime method returns TRUE if its argument is an object of class ElapsedTime.

Objects from the Class

Although objects of the class can be created by a direct call to new, the preferred method is to use the ElapsedTime generator function.

Slots

start:

numeric scalar specifying the elapsed time for the currently running R process (taken from proc.time when created)

Methods

elapsed

signature(object = "ElapsedTime"):
Returns object of class difftime representing elapsed time difference between current time and the start slot value.

Units may be specified if desired; otherwise, the largest possible unit in which difference is greater than one will be chosen.

Author(s)

P. Roebuck [email protected]

See Also

difftime

Examples

1
2
3
4
5
6
7
showClass("ElapsedTime")
et <- ElapsedTime()
elapsed(et)                  # 'auto' reports 'secs' as less than minute later
elapsed(et, units="secs")
elapsed(et, units="mins")
elapsed(et, units="hours")
elapsed(et, units="days")

SuperCurve documentation built on Nov. 17, 2017, 2:28 p.m.