我试图使用这个网站的cron表达http://www.cronmaker.com/
@Scheduled(cron = "0 0/15 * 1/1 * ? *")
public void clearRps() {
}
Run Code Online (Sandbox Code Playgroud)
但它抛出:java.lang.IllegalStateException:遇到无效的@Scheduled方法'clearRps':Cron表达式必须包含6个字段(在"0 0/15*1/1*?*"中找到7)
我正在尝试编写一个函数,它将返回自 1970 年以来以微秒为单位的当前时间。在调试时我注意到,返回的数字太小。例如:269104616249。我还添加了 static_assert 来检查返回值类型是否为 int64_t,它足够大,可以以292471微秒为单位保存多年。所以这里不应该出现整数溢出。我究竟做错了什么?这是我的代码:
int64_t NowInMicroseconds() {
static_assert(std::is_same<decltype(duration_cast<microseconds>(high_resolution_clock::now().time_since_epoch()).count()), int64_t>::value);
return duration_cast<microseconds>(high_resolution_clock::now().time_since_epoch()).count();
}
int64_t result = NowInMicroseconds();
Run Code Online (Sandbox Code Playgroud) 我可以创建名称为values-21、values-22 的文件夹。但它会产生代码重复。我可以创建类似 value-21>= 的东西吗?