#!/bin/bash
function get_time()
{
while [ 1 ]
do
date +%s%3N
mysql -h172.22.32.5 -P3306 -uadmin -pLIUrong123@ -e ‘insert into demo_test.t1 values (now(), 2);‘
if [ $? -eq 0 ]; then
echo "ok"
else
echo "err-----"
fi
sleep 0.1
done
}
get_time
运行:
sh get_time.sh > log
然后从log中查看err,ok的时间戳
或者从mysql数据库中查看values值