Skip to content

Commit

Permalink
Use time instead of datetime
Browse files Browse the repository at this point in the history
use time instead of datetime
  • Loading branch information
stanley31huang committed Apr 19, 2024
1 parent b625a4d commit bd0c8ba
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python3

import argparse
import datetime
import os
import sys
import time
Expand All @@ -10,7 +9,6 @@
import shlex
import select
import logging
import concurrent.futures
import threading
from systemd import journal
from pathlib import Path
Expand Down Expand Up @@ -172,7 +170,7 @@ def lookup_pingpong_logs(self):

def monitor_journal_pingpong_logs(self):

start_time = datetime.datetime.now()
start_time = time.time()
logging.info("# start time: %s", start_time)

self.pingpong_events = []
Expand All @@ -182,8 +180,8 @@ def monitor_journal_pingpong_logs(self):
if self.lookup_pingpong_logs() is False:
return self.pingpong_events

cur_time = datetime.datetime.now()
if (cur_time - start_time).total_seconds() > 60:
cur_time = time.time()
if (cur_time - start_time) > 60:
return self.pingpong_events

def pingpong_test(self):
Expand Down

0 comments on commit bd0c8ba

Please sign in to comment.