<commit_before>//
//  TimeInterval+TimeUnits.swift
//
//  Created by <NAME> on 1/13/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import Foundation


extension TimeInterval {
	/// Provides a representation of the TimeInterval in the form of hours, minutes, and seconds as integers.
	var timeUnits: (hours: Int, minutes: Int, seconds: Int) {
		let interval = Int(self)
		return (interval / 3600, (interval % 3600) / 60, (interval % 3600) % 60)
	}
}<commit_msg>Add More TimeInterval helper properties & methods.<commit_after>//
//  TimeInterval+TimeUnits.swift
//
//  Created by <NAME> on 1/13/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import Foundation


extension TimeInterval {
	/// Provides a representation of the TimeInterval in the form of hours, minutes, and seconds as integers.
	var timeUnits: (hours: Int, minutes: Int, seconds: Int) {
		let interval = Int(self)
		return (interval / 3600, (interval % 3600) / 60, (interval % 3600) % 60)
	}
}


extension TimeInterval {
	var second: TimeInterval {
		return self.seconds
	}
	
	var seconds: TimeInterval {
		return self
	}
	
	var minute: TimeInterval {
		return self.minutes
	}
	
	var minutes: TimeInterval {
		let secondsInAMinute = 60 as TimeInterval
		return self * secondsInAMinute
	}
	
	var day: TimeInterval {
		return self.days
	}
	
	var days: TimeInterval {
		let secondsInADay = 86_400 as TimeInterval
		return self * secondsInADay
	}
	
	var fromNow: Date {
		let timeInterval = self
		return Date().addingTimeInterval(timeInterval)
	}
	
	func from(_ date: Date) -> Date {
		let timeInterval = self
		return date.addingTimeInterval(timeInterval)
	}
	
	var ago: Date {
		let timeInterval = self
		return Date().addingTimeInterval(-timeInterval)
	}
}
{'fraction_non_alphanumeric': 0.10390355912743972, 'fraction_numerical': 0.032721010332950634, 'mean_word_length': 3.4692307692307693, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6859273', 'n_tokens_mistral': 625, 'n_tokens_neox': 537, 'n_words': 183}