From 8b3d8b11af69d8f9b7bddd26b9b477cd39eada6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E4=BD=B3=E5=87=AF?= <1254589836@qq.com> Date: Fri, 12 Jul 2024 08:44:05 +0800 Subject: [PATCH] sh runtime --- 24-07/caffe/shell/caffe-aarch64.sh | 6 ++++++ 24-07/caffe/shell/caffe-riscv64.sh | 6 ++++++ 24-07/caffe/shell/caffe-test.sh | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/24-07/caffe/shell/caffe-aarch64.sh b/24-07/caffe/shell/caffe-aarch64.sh index 42d0959..70c6aff 100644 --- a/24-07/caffe/shell/caffe-aarch64.sh +++ b/24-07/caffe/shell/caffe-aarch64.sh @@ -2,6 +2,8 @@ set -e # 在遇到非零返回值时立即退出 +start=$(date +%s) + echo "step1: 安装依赖包" # 如果当前用户没有sudo权限,则注释掉下面两行,改用root用户来运行下面两行 sudo dnf install -y leveldb-devel snappy-devel opencv.aarch64 boost-devel hdf5-devel gflags-devel glog-devel lmdb-devel openblas.aarch64 @@ -58,3 +60,7 @@ echo "export CAFFE=$CAFFE" >> ~/.bashrc echo "export PATH=$PATH" >> ~/.bashrc source ~/.bashrc caffe --version || { echo "Caffe build failed"; exit 1; } + +end=$(date +%s) +runtime=$((end-start)) +echo "脚本执行时长: $runtime s" \ No newline at end of file diff --git a/24-07/caffe/shell/caffe-riscv64.sh b/24-07/caffe/shell/caffe-riscv64.sh index 8528cfb..e8d9084 100644 --- a/24-07/caffe/shell/caffe-riscv64.sh +++ b/24-07/caffe/shell/caffe-riscv64.sh @@ -2,6 +2,8 @@ set -e # 在遇到非零返回值时立即退出 +start=$(date +%s) + echo "step1: 安装依赖包" sudo dnf install -y leveldb-devel snappy-devel opencv.riscv64 boost-devel hdf5-devel gflags-devel glog-devel lmdb-devel openblas.riscv64 protobuf-devel.riscv64 sudo dnf install -y git wget tar gcc-c++ unzip automake libtool autoconf @@ -34,3 +36,7 @@ echo "export CAFFE=$CAFFE" >> ~/.bashrc echo "export PATH=$PATH" >> ~/.bashrc source ~/.bashrc caffe --version || { echo "Caffe build failed"; exit 1; } + +end=$(date +%s) +runtime=$((end-start)) +echo "脚本执行时长: $runtime s" \ No newline at end of file diff --git a/24-07/caffe/shell/caffe-test.sh b/24-07/caffe/shell/caffe-test.sh index 13bdcb4..6d8692b 100644 --- a/24-07/caffe/shell/caffe-test.sh +++ b/24-07/caffe/shell/caffe-test.sh @@ -2,6 +2,8 @@ set -e +start=$(date +%s) + # 下载deploy文件到caffe-deploy文件夹 mkdir caffe-deploy; cd caffe-deploy wget https://github.com/6eanut/NOTEBOOK/raw/main/24-07/caffe/deploy/deploy.zip @@ -67,3 +69,7 @@ do echo ""$file"测试完成" fi done + +end=$(date +%s) +runtime=$((end-start)) +echo "脚本执行时长: $runtime s" \ No newline at end of file