Help making sense using timers

Here is my code. any insight would be appreciated!

if (fadeBegin == 1 && currentMillis - fadeTimer >= 120 && fadeCount <254)
{
Serial.println(fadeCount);
Serial.println(currentMillis - fadeTimer);
analogWrite(led, brightness);
brightness = brightness + fadeAmount;
fadeTimer = currentMillis;
fadeCount++;
}

if (fadeCount >= 254)
{
fadeBegin = 0;
fadeCount = 0;
brightness =0;
digitalWrite (led, LOW);
}

Look at what happens in my serial monitor. Everything works fine initially but after fadeCount gets above 40, fadeTimer doesn’t reset to currentMillis and the LED shoots to full brightness, turns off and shoots up again. The LED fade should take around 30 seconds

0
28125
1
121
2
122
3
120
4
120
5
121
6
122
7
120
8
122
9
122
10
123
11
122
12
120
13
121
14
124
15
122
16
120
17
120
18
120
19
120
20
123
21
124
22
122
23
120
24
120
25
120
26
121
27
121
28
120
29
120
30
121
31
120
32
124
33
121
34
121
35
120
36
120
37
120
38
123
39
120
40
65539
41
65541
42
65540
43
65540
44
65540
45
65540
46
65540
47
65540
48
65541
49
65548
50
65547
51
65547
52
65547
53
65549
54
65547
55
65547
56
65547
57
65548
58
65547
59
65548
60
65547
61
65548
62
65547
63
65547
64
65548
65
65548
66
65547
67
65547
68
65548
69
65547
70
65548
71
65547
72
65548
73
65547
74
65547
75
65547
76
65549
77
65547
78
65547
79
65548
80
65547
81
65547
82
65548
83
65548
84
65547
85
65547
86
65547
87
65548
88
65548
89
65547
90
65548
91
65547
92
65547
93
65547
94
65549
95
65547
96
65547
97
65547
98
65548
99
65548
100
65547
101
65548
102
65549
103
65548
104
65548
105
65550
106
65548
107
65548
108
65549
109
65548
110
65549
111
65548
112
65549
113
65548
114
65548
115
65549
116
65549
117
65548
118
65548
119
65549
120
65548
121
65549
122
65549
123
65548
124
65548
125
65549
126
65549
127
65548
128
65548
129
65549
130
65548
131
65548
132
65550
133
65548
134
65548
135
65548
136
65549
137
65549
138
65548
139
65549
140
65548
141
65548
142
65549
143
65549
144
65548
145
65548
146
65549
147
65548
148
65549
149
65549
150
65548
151
65548
152
65548
153
65550
154
65548
155
65548
156
65549
157
65548
158
65549
159
65548
160
65549
161
65548
162
65548
163
65549
164
65549
165
65548
166
65549
167
65548
168
65548
169
65549
170
65549
171
65548
172
65548
173
65549
174
65549
175
65548
176
65548
177
65549
178
65548
179
65548
180
65550
181
65548
182
65548
183
65548
184
65549
185
65549
186
65548
187
65549
188
65548
189
65548
190
65550
191
65548
192
65548
193
65548
194
65549
195
65548
196
65549
197
65549
198
65548
199
65548
200
65548
201
65550
202
65548
203
65548
204
65549
205
65548
206
65549
207
65549
208
65548
209
65548
210
65548
211
65549
212
65549
213
65548
214
65549
215
65548
216
65548
217
65549
218
65549
219
65548
220
65548
221
65549
222
65549
223
65548
224
65548
225
65549
226
65548
227
65548
228
65550
229
65548
230
65548
231
65549
232
65548
233
65549
234
65548
235
65549
236
65548
237
65548
238
65550
239
65548
240
65548
241
65548
242
65549
243
65548
244
65549
245
65549
246
65548
247
65548
248
65548
249
65550
250
65548
251
65548
252
65549
253
65548
0
65549
1
65546
2
65547
3
65546
4
65546

Please post your whole program so that we can see where and how the variables are declared

Could it be because you used type int for currentMillis in the code your snippet doesn't include?

0
28125
1
121
2
122
3
120
4
120
5
121
6
122
7
120
8
122
9
122
10
123
11
122
12
120

28125 + 39 x 121 = 32844 --- biggest int = 32767

At least use unsigned int, good for timing 65.535 second intervals.
Arduino millis() and micros() return unsigned long values good for 49.7some day intervals.

GoForSmoke:
Could it be because you used type int for currentMillis in the code your snippet doesn't include?

28125 + 39 x 121 = 32844 --- biggest int = 32767

At least use unsigned int, good for timing 65.535 second intervals.
Arduino millis() and micros() return unsigned long values good for 49.7some day intervals.

yes, I used int. Thanks!