Skip to content

Instantly share code, notes, and snippets.

@cutebomb
cutebomb / run_time.cc
Created January 18, 2023 14:16
c++ run time code
#include <chrono>
using namespace std::chrono;
auto start = high_resolution_clock::now();
// some code here
auto stop = high_resolution_clock::now();
auto duration = duration_cast<milliseconds>(stop - start);
cout << duration.count() << "ms" << endl;
@cutebomb
cutebomb / ax2.py
Last active July 20, 2022 08:05
matplotlib ax2
import matplotlib.pyplot as plt
fig = plt.figure()
ax1 = fig.add_subplot(111)
ax1.plot(v1)
ax2 = ax1.twinx()
ax2.plot(v2, 'y')