Test on MacBook Air (11-inch, Early 2015) 1.6 GHz Intel Core i5
List: List Time used: 7.607762999999999
import time
start = time.clock()
a = range(10000000)
b = range(10000000)| import Foundation | |
| protocol CommandExecuting { | |
| func execute(commandName: String) -> String? | |
| func execute(commandName: String, arguments: [String]) -> String? | |
| } | |
| final class Bash: CommandExecuting { | |
| // MARK: - CommandExecuting |
| #! /usr/bin/swift | |
| import ScriptingBridge | |
| @objc protocol iTunesTrack { | |
| optional var name: String {get} | |
| optional var album: String {get} | |
| } | |
| @objc protocol iTunesApplication { |
| func timeAgoSinceDate(date:NSDate, numericDates:Bool) -> String { | |
| let calendar = NSCalendar.currentCalendar() | |
| let unitFlags = NSCalendarUnit.CalendarUnitMinute | NSCalendarUnit.CalendarUnitHour | NSCalendarUnit.CalendarUnitDay | NSCalendarUnit.CalendarUnitWeekOfYear | NSCalendarUnit.CalendarUnitMonth | NSCalendarUnit.CalendarUnitYear | NSCalendarUnit.CalendarUnitSecond | |
| let now = NSDate() | |
| let earliest = now.earlierDate(date) | |
| let latest = (earliest == now) ? date : now | |
| let components:NSDateComponents = calendar.components(unitFlags, fromDate: earliest, toDate: latest, options: nil) | |
| if (components.year >= 2) { | |
| return "\(components.year) years ago" |
| <?xml version="1.0" encoding="utf-8"?> | |
| <rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns:dc="http://purl.org/dc/elements/1.1/"> | |
| <channel> | |
| <title>B-CheckNewVersion</title> | |
| <link>http://sparkle-project.org/files/sparkletestcast.xml</link> | |
| <description>Most recent changes with links to updates.</description> | |
| <language>en</language> | |
| <item> | |
| <title>版本 2.1</title> | |
| <description> |
| # | |
| # Uncrustify Configuration File | |
| # File Created With UncrustifyX 0.4.3 (252) | |
| # | |
| # Alignment | |
| # --------- | |
| ## Alignment |