This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <chrono> | |
#include <utility> | |
/** | |
* @brief find execution time of a function with non-void return type | |
* | |
* @tparam F function signature in form return_type(args...). Eg: double(int, int, char*) | |
* @tparam R set clock resolution from chrono clock (default = std::chrono::microseconds) | |
* @tparam Args varidac typenames for function arguments | |
* @param dt execution time as per resolution given in R |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Combining coroutines running in an asyncio event loop with | |
# blocking tasks in thread pool and process pool executors. | |
# | |
# Based on https://pymotw.com/3/asyncio/executors.html, but this version runs both | |
# threads and processes at the same time and interleaves them with asyncio coroutines. | |
# | |
# All appears to be working. | |
# |
OlderNewer