Skip to content

Commit c11cab4

Browse files
Updated transaction tests to time the entire transaction and not just the contents
1 parent 234f9c5 commit c11cab4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Tests/CodableDatastoreTests/DiskPersistenceDatastoreTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,14 @@ final class DiskPersistenceDatastoreTests: XCTestCase {
125125

126126
let start = ProcessInfo.processInfo.systemUptime
127127
for n in 1...5 {
128+
let time = ProcessInfo.processInfo.systemUptime
128129
try await persistence.perform { persistence in
129-
let time = ProcessInfo.processInfo.systemUptime
130130
for _ in 0..<5000 {
131131
try await datastore.persist(TestStruct(value: valueBank.randomElement()!))
132132
}
133-
let now = ProcessInfo.processInfo.systemUptime
134-
print("\(n*5000): \((100*(now - time)).rounded()/100)s - total: \((10*(now - start)).rounded()/10)s")
135133
}
134+
let now = ProcessInfo.processInfo.systemUptime
135+
print("\(n*5000): \((100*(now - time)).rounded()/100)s - total: \((10*(now - start)).rounded()/10)s")
136136
}
137137
}
138138
}

0 commit comments

Comments
 (0)