Chrome效果日志消息中的时间戳格式是什么?

时间:2018-04-13 08:23:58

标签: python google-chrome selenium

我正在使用Selenium和ChromeDriver来获取Chrome的效果日志。

caps = DesiredCapabilities.CHROME
caps['loggingPrefs'] = {'performance': 'ALL'}

driver = webdriver.Chrome(desired_capabilities=caps)
driver.get("some.website")
time.sleep(5)

for entry in driver.get_log('performance'):
    print(entry)

检查这些消息后,我发现了一个带有奇怪值的timestamp字段(779922.902049)。所以我的问题是这个timestamp字段的格式是什么?

{'message': '{"message":{"method":"Network.responseReceived","params":{"frameId":"29983.1","loaderId":"29983.1","requestId":"29983.1","response":{"connectionId":0,"connectionReused":false,"encodedDataLength":0,"fromDiskCache":fals
e,"fromServiceWorker":false,"headers":{"Access-Control-Allow-Origin":"*","Content-Type":"text/plain;charset=US-ASCII"},"mimeType":"text/plain","protocol":"data","securityState":"unknown","status":200,"statusText":"OK","url":"data:
,"},"timestamp":779922.902049,"type":"Document"}},"webview":"e6d532fe-f007-4397-bf28-4c4a26c79e4d"}', 'level': 'INFO', 'timestamp': 1523607170083}

{'message': '{"message":{"method":"Network.loadingFinished","params":{"encodedDataLength":0,"requestId":"29983.1","timestamp":779922.902067}},"webview":"e6d532fe-f007-4397-bf28-4c4a26c79e4d"}', 'level': 'INFO', 'timestamp': 152360
7170083}

注意在上述消息中还有另一个timestamp字段,这是自纪元以来的毫秒数。但这不是我要求的领域。

1 个答案:

答案 0 :(得分:1)

我发现它是从上次系统启动时间(即系统正常运行时间)开始的秒数。我找不到任何描述此时间戳格式的文档。