     func testSpanError() {
         let attributes = ["error.type": AttributeValue.string(self.name),
                           "error.message": AttributeValue.string("server error")]
-        let startMicroseconds = UInt64(Date().timeIntervalSince1970 * 1000000)
+        let startMicroseconds = UInt64(Date().timeIntervalSince1970 * microsecondsInSecond)
         let endMicroseconds = startMicroseconds + 900
 
         var span = SpanData(traceId: TraceId(fromHexString: AdapterTests.traceId),
                             spanId: SpanId(fromHexString: AdapterTests.spanId),
                             name: "GET /api/endpoint",
                             kind: .server,
-                            startTime: Date(timeIntervalSince1970: Double(startMicroseconds) / 1000000),
-                            endTime: Date(timeIntervalSince1970: Double(endMicroseconds) / 1000000))
+                            startTime: Date(timeIntervalSince1970: Double(startMicroseconds) / microsecondsInSecond),
+                            endTime: Date(timeIntervalSince1970: Double(endMicroseconds) / microsecondsInSecond))
         span.settingHasEnded(true)
         span.settingStatus(.error(description: "GenericError"))
         span.settingAttributes(attributes)

    }

    func testStatusNotOk() {
        let startMicroseconds = UInt64(Date().timeIntervalSince1970 * 1000000)
        let endMicroseconds = startMicroseconds + 900

        let span = SpanData(traceId: TraceId(fromHexString: AdapterTests.traceId),


    func testProtoSpan() {
        let duration = 900 // microseconds
        let startMicroseconds = UInt64(Date().timeIntervalSince1970 * microsecondsInSecond)
        let endMicroseconds = startMicroseconds + UInt64(duration)

        let span = getSpanData(startMicroseconds: startMicroseconds, endMicroseconds: endMicroseconds)
