diff --git a/data_processing.ipynb b/data_processing.ipynb index 1bbe2ec..763ad94 100644 --- a/data_processing.ipynb +++ b/data_processing.ipynb @@ -79,6 +79,7 @@ "source": [ "# Necessary imports\n", "\n", + "from datetime import datetime, timedelta\n", "import os\n", "import re\n", "import json\n", @@ -102,8 +103,10 @@ "metadata": {}, "outputs": [], "source": [ - "# Checking where we are\n", + "# Start timer\n", + "start_time = datetime.now()\n", "\n", + "# Check where we are\n", "!pwd" ] }, @@ -804,6 +807,30 @@ "cbar_ax.set_title('nT/V', size=12)\n", "plt.show\n" ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9128d799", + "metadata": {}, + "outputs": [], + "source": [ + "# Indicate duration of data processing\n", + "\n", + "end_time = datetime.now()\n", + "total_time = (end_time - start_time).total_seconds()\n", + "\n", + "# Convert seconds to a timedelta object\n", + "total_time_delta = timedelta(seconds=total_time)\n", + "\n", + "# Format the timedelta object to a string\n", + "formatted_time = str(total_time_delta)\n", + "\n", + "# Pad the string representation if less than an hour\n", + "formatted_time = formatted_time.rjust(8, '0')\n", + "\n", + "print(f\"Total Runtime [hour:min:sec]: {formatted_time}\")" + ] } ], "metadata": {