注意是每天,定时任务暂时不考虑
Your Answer
5 answers
Map
把日期作为key,从里面读取变量值,如果不存在,返回1,同时把1存回去如果存在,则+1,存回去,并返回
如果要持久化,则存到数据库里或者是文件里,redis也可以
while (true){
i ++;
try {
Thread.sleep(24L * 60 * 60 * 1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
变量递增?今天有个变量叫a1,明天有个变量a2?很好奇用途是什么?用redis吧,变量用日期吧,需要的时候从redis拿,如果存在直接拿,如果是第一次拿不存在,就设置一个。
Hot tools Tags
Hot Questions
How does AJAX work?
2026-01-03 20:01:15
Dynamically allocating an array of objects
2026-01-03 19:43:11
What is the difference between venv, pyvenv, pyenv, virtualenv, virtualenvwrapper, pipenv, etc?
2026-01-03 19:22:11
Is a null reference possible?
2026-01-03 19:00:11
How to make a class property? [duplicate]
2026-01-03 18:22:28
Popular tool
vc9-vc14 (32+64 bit) runtime library collection (link below)
Download the collection of runtime libraries required for phpStudy installation
VC9 32-bit
VC9 32-bit phpstudy integrated installation environment runtime library
PHP programmer toolbox full version
Programmer Toolbox v1.0 PHP Integrated Environment
VC11 32-bit
VC11 32-bit phpstudy integrated installation environment runtime library
SublimeText3 Chinese version
Chinese version, very easy to use
Hot Topics
Douyin level price list 1-75
20416
7
20416
7
wifi shows no ip assigned
13576
4
13576
4
Hot Article
How to set up price alerts so you don't miss key entry points?
2026-01-01
By DDD
Why do professional traders advise newbies to start with low leverage?
2026-01-01
By DDD
Tutorial on existence check of nested array values in PHP multidimensional array
2025-12-28
By DDD
How to draw dotted lines in PS How to draw various dotted lines in PS
2025-12-28
By DDD






