//
//  XTTimer.m
//  XTads
//
//  Created by Rune Berg on 04/08/2017.
//  Copyright © 2017 Rune Berg. All rights reserved.
//

#import "XTTimer.h"


@interface XTTimer ()

@property NSDate *started;

@end

@implementation XTTimer

+ (instancetype)fromNow
{
	XTTimer *timer = [XTTimer new];
	timer.started = [NSDate date];
	return timer;
}

- (NSTimeInterval)timeElapsed
{
	NSDate *now = [NSDate date];
	NSTimeInterval res = [now timeIntervalSinceDate:self.started];
	return res;
}

@end
